|
|
|
|
|
by kps
1900 days ago
|
|
No, `keyCode` can also change with layout. Since you mentioned WASD, ‘W’ on a US layout has `keyCode` 87. Select a French layout, and the same physical key now has `keyCode` 90. If you're using `keyCode` for anything, you're doing it wrong. There's a reason it's marked ‘legacy’. Physical key position is the UI Event ‘code’, which is in this example will be "KeyW" regardless of layout. This field is essentially 1:1 with hardware HID codes (as used by USB and Bluetooth keyboards). |
|