Skip to content

Commit

Permalink
Ignore physical keycodes when not supported (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhoad authored Dec 15, 2024
1 parent 5ab07bd commit c64e811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/input_helper/input_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func get_label_for_input(input: InputEvent) -> String:
if input == null: return ""

if input is InputEventKey:
if input.physical_keycode > 0:
var keycode := DisplayServer.keyboard_get_keycode_from_physical(input.physical_keycode)
if input.physical_keycode > 0 and DisplayServer.keyboard_get_current_layout() > -1:
var keycode: Key = DisplayServer.keyboard_get_keycode_from_physical(input.physical_keycode)
return OS.get_keycode_string(keycode)
elif input.keycode > 0:
return OS.get_keycode_string(input.keycode)
Expand Down

0 comments on commit c64e811

Please sign in to comment.