Skip to content

Commit

Permalink
Adjust get_action_key() for physical keys (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Exerionius authored Dec 19, 2022
1 parent c808216 commit 434ea9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addons/input_helper/input_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func is_valid_key(key: String) -> bool:
func get_action_key(action: String) -> String:
for event in InputMap.get_action_list(action):
if event is InputEventKey:
return event.as_text()
var scancode = OS.keyboard_get_scancode_from_physical(physical_scancode) if event.physical_scancode != 0 else event.scancode
return OS.get_scancode_string(scancode)
return ""


Expand Down

0 comments on commit 434ea9a

Please sign in to comment.