Orama-Interactive/Keychain

[4.x] `ShortcutEdit.event_to_str` will produce an incomplete event string if modifiers are pressed

Spartan322 opened this issue · 1 comments

if event is InputEventKey:
var scancode: int = event.get_keycode_with_modifiers()
var physical_str := ""
if scancode == 0:
scancode = event.get_physical_keycode_with_modifiers()
physical_str = " " + tr("(Physical)")
output = OS.get_keycode_string(scancode) + physical_str

Event.get_keycode_with_modifiers will never be 0 if a modifier is pressed, so in the case you use physical keycodes in the InputMap, it will never refer to the physical keycode and so if you have Ctrl+A for your action, it will instead report Ctrl+ skipping over the physical keycode retrieval. Should check if event.keycode == 0.

Should be fixed by c1089fb.