fix(input): keys are physical positions on every layout; Input.key_label names them
The Windows runtime keyed the held set by the character MapVirtualKeyA gave a virtual key, so a game's WASD belonged to whatever the active layout put there, and with an input method on every letter arrived as VK_PROCESSKEY. The typing block is now read from the scancode (the arrows, numpad and F-keys still by virtual key); macOS reads keyCode the same way. Input.key_label(key) names a key in the player's own layout (Windows) or as its US character elsewhere. Verified on Windows with SendInput into a live window: VK_Z carrying W's scancode holds 'w', VK_PROCESSKEY carrying A's holds 'a', Caps Lock changes nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
2a2f463d5b
commit
619476ffed
14 changed files with 60552 additions and 60168 deletions
|
|
@ -108,6 +108,7 @@ function emit_header() -> void {
|
|||
emith("declare i32 @win_running()\n")
|
||||
emith("declare void @win_close()\n")
|
||||
emith("declare void @win_held(ptr)\n")
|
||||
emith("declare i32 @win_key_char(i32)\n")
|
||||
emith("declare void @win_mouse(ptr)\n")
|
||||
emith("declare void @win_pad(ptr)\n")
|
||||
emith("declare void @win_touch(ptr)\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue