Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Keyboard module improvements

Compare
Choose a tag to compare
@jeffpar jeffpar released this 10 Dec 01:26
· 4261 commits to master since this release

No new real features, just some much-needed code cleanup in the Keyboard module. I'm aware of a few regressions, but they're mostly related to "soft keyboards" (eg, support for upper and lower case). Soft keyboard support is overdue for some attention anyway.

The important thing is that all key handling, whether from actual key events or from the various ways in which keys and key combinations can be simulated, is now funneled through a simple set of methods (eg, addActiveKey(), updateActiveKey(), removeActiveKey()) which in turn call keySimulate() to simulate all the necessary "make" and "break" scan codes.

This fixes a number of obscure bugs (eg, different results depending on whether a CTRL-[character] sequence released the CTRL key first or the [character] key first, and the failure of many keys to repeat properly).

The new code will also make it much easier to implement programmable repeat delay/rate for PC AT keyboards. Currently, repeat delay and repeat rate are hard-coded with the PC XT keyboard defaults of 0.5sec and 0.1sec, respectively.

In the course of debugging the new Keyboard module, I also uncovered some hidden bugs in the 8042 code of the Chipset module. The most severe was that the "break" code for a completed key press was not being delivered until the beginning of the next key press; it's surprising that the PC AT configurations worked at all. The interface between the 8042 code and the Keyboard module has been cleaned up a bit, and that bug should be fixed now.