Open nezvers opened 1 year ago
@nezvers have you redefined the event ui_undo
? The combination Ctrl+Shift+Z
is set there. I redefine it and it works.
@Vilcrow As I wrote in the description. I tried to:
It works for the Godot editor itself, it doesn't work for a game.
This is due to non-QWERTY keyboard layouts being broken currently, possibly by https://github.com/godotengine/godot/pull/70052. cc @bruvzg
I can reproduce this in the editor on 4.0.beta 4fa6edc88 (French AZERTY layout on Linux). I have to press Ctrl + W instead of Ctrl + Z for undo to work.
Tested on X11 and macOS with current master and beta 14 using QWERTY and AZERTY layouts, everything works in editor (undo/redo in the script editor). When running the project:
Seems like there is physical keycode Ctrl+Y
and physical Shift+Ctrl+Z
actions saved in the project.godot
.
Yes there is a physical keycode, because:
Physical and non-physical Ctrl+Shift+Z
does NOT work. At least on my QWERTY Windows machine. In the editor, it works.
Physical and non-physical Ctrl+Y
works
OK, found unrelated issue with a #70052 (will fix in a moment).
It works if it's done like this. Default behavior is exact_match = false
, without exact_match = true
it was matching Ctrl+Z
to Ctrl+Shift+Z
and triggering ui_undo
first:
func _unhandled_input(event:InputEvent)->void:
if event.is_action_pressed("ui_undo", false, true): # action name, allow echo, exact match
print("Undo")
undoRedoResource.undo()
if event.is_action_pressed("ui_redo", false, true):
print("Redo")
undoRedoResource.redo()
So it's a feature, but I do not think it's a good thing to have by default.
That seems extra frustrating either way - when action is pressed and it doesn't work or action gets triggered when there are held extra optional keys. Still, thank you, @bruvzg, for your help!
I have similar problem with different shortcuts setting a new one
For example for Show in Filesystem
If I set Ctrl+e as shortcut it will not trigger, instead it will write e
in editor
v4.0.rc2.official [d2699dc7a] Debian 11
I have similar problem with different shortcuts setting a new one For example for
Show in Filesystem
If I set Ctrl+e as shortcut it will not trigger, instead it will writee
in editor
Similar to #74181.
Godot version
4, Beta 14
System information
Windows 10
Issue description
Physical and non-physical
Ctrl+Shift+Z
does NOT work. Physical and non-physicalCtrl+Y
worksui_redo
is triggering withCtrl+Y
but not withCtrl+Shift+Z
I tried to:Ctrl+Shift+Z
event. Note - it stayed non-physical.Ctrl+Y
eventCtrl+Shift+Z
. Note - it was created as physical.PS. It works for the Godot editor itself, it doesn't work for a game.
Steps to reproduce
Create a script that uses the action
Ctrl+Shift+Z
Minimal reproduction project
Currently both actions as Physical from my QWERTY layout. Discovered while making this project. The action is used in the
main.gd
. DIY UndoRedo.zip