apsun / loliOS

Lightweight & operational Linux-inspired OS.
33 stars 1 forks source link

Keyboard state out of sync #6

Closed apsun closed 6 years ago

apsun commented 7 years ago

Currently we only detect deltas, not full states. This causes 2 annoying bugs:

  1. If caps lock is ON when the machine boots, the states will be flipped (i.e. ON -> OFF, OFF -> ON).
  2. Some keyboards (like mine) do not distinguish left/right alt/ctrl keys. This means that if both keys are pressed down, then one is released, the modifier state will change to unpressed even though the other key is still down.

We can probably fix this by polling the complete modifier state every time one of them changes.

apsun commented 7 years ago

Apparently my understanding was incorrect; the keyboard doesn't keep track of what "toggle" keys have been pressed; rather, it's the OS that's responsible for manually setting the LEDs on the keyboard (like the CapsLock LED) to match its internal keyboard state. Maybe we should do that?

apsun commented 6 years ago

Just learned that QEMU does not support setting the keyboard LEDs. Oh well.