w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 51 forks source link

Giving JavaScript ability to toggle the state of the modifier keys #274

Open gked opened 3 years ago

gked commented 3 years ago

Outlook Web Client has a scenario where it would like to be able to toggle the state of modifier keys, e.g. CapsLock, Insert Key, etc.

I was wondering whether there was ever a conversation around providing something like setModifierState(keyArg) to allow JS to modify the state of the modifier key?

I understand there maybe repercussions to this so I am open to any shape of the API as long as it gives similar ability to Outlook and other web authors desiring to toggle the state of a modifier.

garykac commented 3 years ago

Does passing synthetic keydown/up events not work for this?

rniwa commented 3 years ago

Is this about manipulating modifier states of DOM events or actually affecting system's modifier key states.