Browse Source

Remove some useless macros and update for new Kaleidoscope

Signed-off-by: Gavin Howard <gavin@yzena.com>
master
Gavin Howard 7 months ago
parent
commit
797a6ef6e6
Signed by: gavin GPG Key ID: C08038BDF280D33E
  1. 86
      Model01-Firmware.ino

86
Model01-Firmware.ino

@ -103,10 +103,6 @@ enum { MACRO_VERSION_INFO,
MACRO_CTRL_I,
MACRO_CTRL_E,
MACRO_MAXIMIZE,
MACRO_MOVE_WIN_UP,
MACRO_MOVE_WIN_DOWN,
MACRO_MOVE_WIN_LEFT,
MACRO_MOVE_WIN_RIGHT,
MACRO_MOVE_UP,
MACRO_MOVE_DOWN,
MACRO_CLOSE,
@ -304,10 +300,10 @@ KEYMAPS(
___),
[FUNCTION] = KEYMAP_STACKED
(M(MACRO_CLOSE), Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, M(MACRO_MOVE_UP),
M(MACRO_CTRL_ALT_T), M(MACRO_MAXIMIZE), M(MACRO_CTRL_W), M(MACRO_CTRL_E), M(MACRO_MOVE_WIN_UP), M(MACRO_CTRL_T), M(MACRO_MOVE_DOWN),
Key_Home, M(MACRO_CTRL_A), M(MACRO_CTRL_S), M(MACRO_MOVE_WIN_LEFT), M(MACRO_MOVE_WIN_DOWN), M(MACRO_MOVE_WIN_RIGHT),
Key_End, M(MACRO_CTRL_Z), M(MACRO_CTRL_X), M(MACRO_CTRL_C), M(MACRO_CTRL_V), M(MACRO_CTRL_F), M(MACRO_CLOSE),
(M(MACRO_CLOSE), Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, M(MACRO_MOVE_UP),
M(MACRO_CTRL_ALT_T), M(MACRO_MAXIMIZE), M(MACRO_CTRL_W), M(MACRO_CTRL_E), ___, M(MACRO_CTRL_T), M(MACRO_MOVE_DOWN),
Key_Home, M(MACRO_CTRL_A), M(MACRO_CTRL_S), ___, ___, ___,
Key_End, M(MACRO_CTRL_Z), M(MACRO_CTRL_X), M(MACRO_CTRL_C), M(MACRO_CTRL_V), M(MACRO_CTRL_F), M(MACRO_CLOSE),
___, Key_Delete, ___, ___,
___,
@ -319,10 +315,10 @@ KEYMAPS(
___),
[FUNCTION_DVORAK] = KEYMAP_STACKED
(LockLayer(DVORAK_REV), Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, M(MACRO_MOVE_UP),
M(MACRO_CTRL_ALT_T), M(MACRO_MAXIMIZE), M(MACRO_CTRL_W), M(MACRO_CTRL_E), M(MACRO_MOVE_WIN_UP), M(MACRO_CTRL_T), M(MACRO_MOVE_DOWN),
Key_Home, M(MACRO_CTRL_A), M(MACRO_CTRL_S), M(MACRO_MOVE_WIN_LEFT), M(MACRO_MOVE_WIN_DOWN), M(MACRO_MOVE_WIN_RIGHT),
Key_End, M(MACRO_CTRL_Z), M(MACRO_CTRL_X), M(MACRO_CTRL_C), M(MACRO_CTRL_V), M(MACRO_CTRL_F), M(MACRO_CLOSE),
(LockLayer(DVORAK_REV), Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, M(MACRO_MOVE_UP),
M(MACRO_CTRL_ALT_T), M(MACRO_MAXIMIZE), M(MACRO_CTRL_W), M(MACRO_CTRL_E), ___, M(MACRO_CTRL_T), M(MACRO_MOVE_DOWN),
Key_Home, M(MACRO_CTRL_A), M(MACRO_CTRL_S), ___, ___, ___,
Key_End, M(MACRO_CTRL_Z), M(MACRO_CTRL_X), M(MACRO_CTRL_C), M(MACRO_CTRL_V), M(MACRO_CTRL_F), M(MACRO_CLOSE),
___, Key_Delete, ShiftToLayer(DVORAK_REV), ___,
___,
@ -391,83 +387,72 @@ static void anyKeyMacro(uint8_t keyState) {
* These are mostly to give me QWERTY shortcuts while using DVORAK.
*/
static const macro_t *gdh_macro(uint8_t idx, uint8_t keyState) {
static const macro_t *gdh_macro(uint8_t idx) {
switch (idx) {
case MACRO_CTRL_W:
return MACRODOWN(D(LeftControl), T(W));
return MACRO(D(LeftControl), T(W));
case MACRO_CTRL_T:
return MACRODOWN(D(LeftControl), T(T));
return MACRO(D(LeftControl), T(T));
case MACRO_CTRL_A:
return MACRODOWN(D(LeftControl), T(A));
return MACRO(D(LeftControl), T(A));
case MACRO_CTRL_S:
return MACRODOWN(D(LeftControl), T(S));
return MACRO(D(LeftControl), T(S));
case MACRO_CTRL_F:
return MACRODOWN(D(LeftControl), T(F));
return MACRO(D(LeftControl), T(F));
case MACRO_CTRL_Z:
return MACRODOWN(Dr(Key_LeftControl), Dr(Key_Z));
return MACRO(Dr(Key_LeftControl), Dr(Key_Z));
case MACRO_CTRL_X:
return MACRODOWN(D(LeftControl), T(X));
return MACRO(D(LeftControl), T(X));
case MACRO_CTRL_C:
return MACRODOWN(D(LeftControl), T(C));
return MACRO(D(LeftControl), T(C));
case MACRO_CTRL_V:
return MACRODOWN(D(LeftControl), T(V));
return MACRO(D(LeftControl), T(V));
case MACRO_CTRL_ALT_T:
return MACRODOWN(D(LeftControl), D(LeftAlt), T(T));
return MACRO(D(LeftControl), D(LeftAlt), T(T));
case MACRO_CTRL_I:
return MACRODOWN(Dr(Key_LeftControl), Dr(Key_I));
return MACRO(Dr(Key_LeftControl), Dr(Key_I));
case MACRO_CTRL_E:
return MACRODOWN(D(LeftControl), T(E));
return MACRO(D(LeftControl), T(E));
case MACRO_MAXIMIZE:
return MACRODOWN(D(LeftControl), D(LeftAlt), T(A));
case MACRO_MOVE_WIN_UP:
return MACRODOWN(D(LeftControl), D(LeftShift), D(LeftAlt), T(UpArrow));
case MACRO_MOVE_WIN_DOWN:
return MACRODOWN(D(LeftControl), D(LeftShift), D(LeftAlt), T(DownArrow));
case MACRO_MOVE_WIN_LEFT:
return MACRODOWN(D(LeftShift), D(LeftGui), T(LeftArrow));
case MACRO_MOVE_WIN_RIGHT:
return MACRODOWN(D(LeftShift), D(LeftGui), T(RightArrow));
return MACRO(D(LeftControl), D(LeftAlt), T(A));
case MACRO_MOVE_UP:
return MACRODOWN(D(LeftControl), D(LeftAlt), T(UpArrow));
return MACRO(D(LeftControl), D(LeftAlt), T(UpArrow));
case MACRO_MOVE_DOWN:
return MACRODOWN(D(LeftControl), D(LeftAlt), T(DownArrow));
return MACRO(D(LeftControl), D(LeftAlt), T(DownArrow));
case MACRO_CLOSE:
return MACRODOWN(D(LeftControl), D(LeftGui), D(LeftShift), T(F4));
return MACRO(D(LeftControl), D(LeftGui), D(LeftShift), T(F4));
case MACRO_LEFT_PAREN:
return MACRODOWN(Dr(Key_LeftShift), Dr(Key_9));
return MACRO(Dr(Key_LeftShift), Dr(Key_9));
case MACRO_RIGHT_PAREN:
return MACRODOWN(Dr(Key_LeftShift), Dr(Key_0));
return MACRO(Dr(Key_LeftShift), Dr(Key_0));
case MACRO_PLAY_PAUSE:
return MACRODOWN(D(LeftControl), D(LeftShift), T(F8));
return MACRO(D(LeftControl), D(LeftShift), T(F8));
case MACRO_PREV_TRACK:
return MACRODOWN(D(LeftControl), D(LeftShift), T(F7));
return MACRO(D(LeftControl), D(LeftShift), T(F7));
case MACRO_NEXT_TRACK:
return MACRODOWN(D(LeftControl), D(LeftShift), T(F9));
return MACRO(D(LeftControl), D(LeftShift), T(F9));
}
return MACRO_NONE;
}
@ -484,11 +469,14 @@ static const macro_t *gdh_macro(uint8_t idx, uint8_t keyState) {
*/
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
const macro_t *macroAction(uint8_t macroIndex, KeyEvent &event) {
if (!keyToggledOn(event.state)) return MACRO_NONE;
switch (macroIndex) {
case MACRO_VERSION_INFO:
versionInfoMacro(keyState);
versionInfoMacro(event.state);
break;
case MACRO_ANY:
@ -496,7 +484,7 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
break;
default:
return gdh_macro(macroIndex, keyState);
return gdh_macro(macroIndex);
}
return MACRO_NONE;
}

Loading…
Cancel
Save