amigahid-pico icon indicating copy to clipboard operation
amigahid-pico copied to clipboard

Caps lock state is inconsistent if system reset occurs whilst caps lock is enabled

Open borb opened this issue 2 years ago • 0 comments

If caps lock has been enabled (caps_lock global set to true in src/platform/amiga/keyboard_serial_io.c), and either the Amiga is reset from the machine-side or by use of the three-fingered-salute, then the caps lock state is inconsistent between the host and the controller. This would mean the caps LED is illuminated, and pressing caps lock will send a caps-release code (0x62 ORed with 0x80). Worst case scenario, this means pressing caps lock twice to get the keyboard into the intended state of being enabled, if required. Minor, I know.

This requires two fixes: ctrl-amiga-amiga should reset any stateful flags (in this case, only caps lock) when reset is asserted. Secondly, if a reset occurs from the Amiga-side, this should be detected and the stateful flags reset. This requires the hid-pico code to monitor. I am not sure how this is achieved (might need to scope the keyboard lines on a real Amiga keyboard to work this out). It's possible a pulse can occur on the reset line to indicate this. The rp2040 can be setup to trigger an interrupt if this occurs, but only if this theory proves to be correct.

borb avatar Sep 07 '23 10:09 borb