3 ms·
The problem is "key down" and "key up" are usually separate events. If you write software in a way that you always expect a "key up" to be preceded by a "key do
by parliament32 6y ago
The problem is "key down" and "key up" are usually separate events. If you write software in a way that you always expect a "key up" to be preceded by a "key down", you'll have problems like the above mentioned.
- filoeleven 6y agoSeems like a great place to use state machines. That’s not a total solution, of course: if “hold X” and “hold A” have very different behaviors, developers still have to code those states to be exclusive...unless they shouldn’t be. Ain’t easy, that’s for sure. A robust solution should probably use state machines coupled with generative testing, so that all of those unexpected combinations can be generated and handled before the testers try button-mashing, without relying on developers to think of and write all the individual test cases.