Sharing a Keyboard
The first bug has to do with powering up the launcher. If player #1 holds down the S key, the launcher powers up like normal. But, if player #2 then presses the K key, player #1’s power up stops.
This bug happens because there’s only one keyboard and keyboards expect that only one person is going to press and hold a key. If you press and hold the S key in a word processor, you’ll get a bunch of Ss in your document—the keyboard repeats the S letter. If you keep the S key down and then hold down the K key at the same time, the computer figures you now want a bunch of Ks added to the document, and switches to repeating the K key.
To make power-ups work when two people are sharing the keyboard, we need to replace keyboard repeats ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access