組合鍵
我想將 0+左/右,一起當組合鍵。 目前組合鍵只能 shift / ctrl +任意1個鍵。
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.