KestrelComputer / kestrel

The Kestrel is a family of home-made computers, built as much as possible on open-source technology, and supporting as much as possible the open-source philosophy.
http://kestrelcomputer.github.io/kestrel
Mozilla Public License 2.0
185 stars 10 forks source link

Problem: BIOS doesn't track shift status. #208

Closed sam-falvo closed 8 years ago

sam-falvo commented 8 years ago

Needed for #201.

It turns out that SDL's key codes for all the shift keys (except for the menu key) follow a really neat pattern that I can exploit:

$x0E0  L CTRL
$x0E1  L SHIFT
$x0E2  L ALT
$x0E3  L CMD
$x0E4  R CTRL
$x0E5  R SHIFT
$x0E6  R ALT
$x0E7  R CMD

We can keep track of shift state in a flag byte, and just set or clear the corresponding bit based on the low 3 bits of the key code!