[w3c/uievents] KeyboardEvent.getKeyState() (Issue #374)

## Problem 

Current web apps and games have trouble supporting non-modifier combination keys as it's difficult to determine which keys are currently pressed down. 

For modifier key combinations like Shift A, it's straightforward as you can check KeyboardEvent.shiftKey or KeyboardEvent.getModifierState. 

Listening to other types of combinations like A + S requires non-trivial amount of work and error testing. 

## Proposal 

A method that tells you if a non-modifier key is currently pressed down. Similar to KeyboardEvent.getModifierState. 

```js
KeyboardEvent.getKeyState({key: "a"}) 

KeyboardEvent.getKeyState({code: "KeyA"})
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/374
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/uievents/issues/374@github.com>

Received on Saturday, 17 February 2024 23:56:20 UTC