Closed sam-falvo closed 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!
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:
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!