globalSpeed icon indicating copy to clipboard operation
globalSpeed copied to clipboard

組合鍵

Open chen7g opened this issue 2 years ago • 1 comments

我想將 0+左/右,一起當組合鍵。 目前組合鍵只能 shift / ctrl +任意1個鍵。

chen7g avatar Sep 13 '23 13:09 chen7g

Hello. This is due to how the KeyboardEvent works in browsers. If a user presses the Left key, it will send an event saying the Left key was pressed, but it will also tell you if any modifier keys like (shift, ctrl, etc) were pressed. This is very convenient. But, It doesn't bundle any other key combinations, only modifier keys are bundled. If you press 0, Left, and Right at same time, it will send three separate events. It's possible to tell if all keys are pressed down at the same time by keeping track of KeyDown and KeyUp events, but it's an unreliable method.

I think I will implement complex keys, but I will hide it under an option so the user know it's not reliable.

polywock avatar Sep 13 '23 14:09 polywock