Split out the left and right alt keys, to make it easier to emulate altgr.

This may or may not actually be useful.
pull/28/head
Jesse Vincent 8 years ago
parent fee2b6dfdf
commit 322c2fa589

@ -15,11 +15,12 @@ typedef union {
#define KEY_FLAGS B00000000 #define KEY_FLAGS B00000000
#define CTRL_HELD B00000001 #define CTRL_HELD B00000001
#define ALT_HELD B00000010 #define LALT_HELD B00000010
#define SHIFT_HELD B00000100 #define RALT_HELD B00000010
#define GUI_HELD B00001000 #define SHIFT_HELD B00001000
#define SWITCH_TO_KEYMAP B00010000 #define GUI_HELD B00010000
#define MOMENTARY B00100000 #define SWITCH_TO_KEYMAP B00100000
#define MOMENTARY B01000000
#define SYNTHETIC_KEY B10000000 #define SYNTHETIC_KEY B10000000
// we assert that synthetic keys can never have keys held, so we reuse the _HELD bits // we assert that synthetic keys can never have keys held, so we reuse the _HELD bits

@ -93,7 +93,10 @@ void press_key(Key mappedKey) {
if (mappedKey.flags & CTRL_HELD) { if (mappedKey.flags & CTRL_HELD) {
Keyboard.press(Key_LCtrl.rawKey); Keyboard.press(Key_LCtrl.rawKey);
} }
if (mappedKey.flags & ALT_HELD) { if (mappedKey.flags & LALT_HELD) {
Keyboard.press(Key_LAlt.rawKey);
}
if (mappedKey.flags & RALT_HELD) {
Keyboard.press(Key_RAlt.rawKey); Keyboard.press(Key_RAlt.rawKey);
} }
if (mappedKey.flags & GUI_HELD) { if (mappedKey.flags & GUI_HELD) {

Loading…
Cancel
Save