dingusdev / dingusppc

An experimental emulator
GNU General Public License v3.0
200 stars 21 forks source link

Fix keyboard events occasionally being dropped #66

Closed mihaip closed 7 months ago

mihaip commented 7 months ago

AdbKeyboard would copy the event into its own fields and set the changed field, so that we could return the event when register was 0. However, if a subsequent event was received before ADB polling, the previous event would be overwritten and lost.

Fix this by maintaining a queue of events, so that we can return everything since the last poll.

mihaip commented 7 months ago

Tested with @joevt's Keyboard Tester app which shows the keymap. Before this patch, if you mashed on a lot of keys repeatedly, you would end up with some keys being stuck on. After this, the keymap always ends up being correctly empty.