first attempt at macro functionalit

pull/18/head
jesse 11 years ago
parent ee38ec62c0
commit db6408c795

@ -199,7 +199,14 @@ void send_key_events(byte layer)
}
}
} else if (mappedKey.flags & SYNTHETIC_KEY) {
if (mappedKey.rawKey == KEY_MOUSE_BTN_L || mappedKey.rawKey == KEY_MOUSE_BTN_M|| mappedKey.rawKey == KEY_MOUSE_BTN_R) {
if(mappedKey.flags & IS_MACRO) {
if (key_toggled_on (switchState)) {
if (mappedKey.rawKey == 1) {
Keyboard.print("Keyboard.IO keyboard driver v0.00");
}
}
}
else if (mappedKey.rawKey == KEY_MOUSE_BTN_L || mappedKey.rawKey == KEY_MOUSE_BTN_M|| mappedKey.rawKey == KEY_MOUSE_BTN_R) {
if (key_toggled_on (switchState)) {
Mouse.press(mappedKey.rawKey);
} else if (key_is_pressed(switchState)) {

@ -8,6 +8,9 @@
#define MOUSE_KEY B01000000
#define SYNTHETIC_KEY B10000000
// we assert that synthetic keys can never have keys held, so we reuse the _HELD bits
#define IS_MACRO B00000001
#define MOUSE_UP B0001
#define MOUSE_DN B0010
#define MOUSE_L B0100
@ -26,7 +29,7 @@
#define NoKey (Key){ KEY_FLAGS,0 }
#define macroKey1 (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MACRO, 1}
#define mouseUpL (Key){ KEY_FLAGS|MOUSE_KEY, MOUSE_UP | MOUSE_L }

@ -9,7 +9,7 @@ static const Key keymaps[LAYERS][ROWS][COLS] = {
},
{
{ NoKey, Key_1, Key_2, Key_3, Key_4, Key_5, NoKey, NoKey, Key_6, Key_7, Key_8, Key_9, Key_0, NoKey },
{ Key_Backtick, Key_Q, mouseBtnL, mouseBtnM, mouseBtnR, Key_T, NoKey, NoKey, Key_LCurlyBracket, Key_RCurlyBracket, Key_LSquareBracket, Key_RSquareBracket, Key_P, Key_Equals},
{ Key_Backtick, macroKey1, mouseBtnL, mouseBtnM, mouseBtnR, Key_T, NoKey, NoKey, Key_LCurlyBracket, Key_RCurlyBracket, Key_LSquareBracket, Key_RSquareBracket, Key_P, Key_Equals},
{ Key_PageUp, mouseL, mouseUp, mouseDn, mouseR, Key_G, Key_Tab, Key_Return, Key_LArrow, Key_DnArrow, Key_UpArrow, Key_RArrow, Key_Semicolon, Key_Quote},
{ Key_PageDn, Key_Z, mouseBtnL, mouseBtnM, mouseBtnR, Key_B, Key_Esc, Key_Return, Key_Pipe, Key_M, Key_Comma, Key_Period, Key_Backslash, Key_Minus},
{ Key_LGUI, Key_Backspace, Key_LShift, Key_LCtrl, NextKeymap, NoKey, NoKey, NoKey, NoKey, NextKeymap, Key_RCtrl, Key_RShift, Key_Space, Key_RAlt }

Loading…
Cancel
Save