-/* Shift state bits. */
-#define LSHIFT 0x01 /* Left Shift. */
-#define RSHIFT 0x02 /* Right Shift. */
-#define LALT 0x04 /* Left Alt. */
-#define RALT 0x08 /* Right Alt. */
-#define LCTRL 0x10 /* Left Ctrl. */
-#define RCTRL 0x20 /* Right Ctrl. */
-#define CAPS 0x40 /* Caps Lock. */
-
-/* Current shift state. */
-static unsigned shift_state;
+/* Current state of shift keys.
+ True if depressed, false otherwise. */
+static bool left_shift, right_shift; /* Left and right Shift keys. */
+static bool left_alt, right_alt; /* Left and right Alt keys. */
+static bool left_ctrl, right_ctrl; /* Left and right Ctl keys. */
+
+/* Status of Caps Lock.
+ True when on, false when off. */
+static bool caps_lock;