summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2019-11-21 18:18:27 +0000
committerdakkar <dakkar@thenautilus.net>2019-11-21 18:29:02 +0000
commit027a45b6b836508d5e4c3d8d5838d3a92069da40 (patch)
treebc97014106fdcf79763304de79e942bdc4948869
parentput raise/lower window on pgup/dn, close window farther away (diff)
downloadkeyboardio-model01-027a45b6b836508d5e4c3d8d5838d3a92069da40.tar.gz
keyboardio-model01-027a45b6b836508d5e4c3d8d5838d3a92069da40.tar.bz2
keyboardio-model01-027a45b6b836508d5e4c3d8d5838d3a92069da40.zip
alt + layer shift
-rw-r--r--keymaps.h22
-rw-r--r--macros.h15
2 files changed, 26 insertions, 11 deletions
diff --git a/keymaps.h b/keymaps.h
index 5793ff7..1f269e0 100644
--- a/keymaps.h
+++ b/keymaps.h
@@ -10,7 +10,7 @@ ColorKeymaps(
CK(Key_PageUp,Base), CK(Key_A,Base), CK(Key_S,Base), CK(Key_D,Base), CK(Key_F,Base), CK(Key_G,Base),
CK(Key_PageDown,Base), CK(Key_Z,Base), CK(Key_X,Base), CK(Key_C,Base), CK(Key_V,Base), CK(Key_B,Base), CK(Key_Escape,Base),
CK(Key_LeftControl,Base), CK(Key_Backspace,Base), CK(Key_LeftGui,Base), CK(Key_LeftShift,Base),
- CK(ShiftToLayer(FVWM),Base),
+ CK(M(MACRO_FVWM),Base),
CK(M(MACRO_ANY),Base), CK(Key_6,Base), CK(Key_7,Base), CK(Key_8,Base), CK(Key_9,Base), CK(Key_0,Base), CK(M(MACRO_NUMLOCK),Base),
CK(Key_Enter,Base), CK(Key_Y,Base), CK(Key_U,Base), CK(Key_I,Base), CK(Key_O,Base), CK(Key_P,Base), CK(Key_Equals,Base),
@@ -27,7 +27,7 @@ ColorKeymaps(
CK(Key_PageUp,Base), CK(Key_A,Base), CK(Key_O,Base), CK(Key_E,Base), CK(Key_U,Base), CK(Key_I,Base),
CK(Key_PageDown,Base), CK(Key_Semicolon,Base), CK(Key_Q,Base), CK(Key_J,Base), CK(Key_K,Base), CK(Key_X,Base), CK(Key_Escape,Base),
CK(Key_LeftControl,Base), CK(Key_Backspace,Base), CK(Key_LeftGui,Base), CK(Key_LeftShift,Base),
- CK(ShiftToLayer(FVWM),Base),
+ CK(M(MACRO_FVWM),Base),
CK(M(MACRO_ANY),Base), CK(Key_6,Base), CK(Key_7,Base), CK(Key_8,Base), CK(Key_9,Base), CK(Key_0,Base), CK(LockLayer(NUMPAD),Base),
CK(Key_Enter,Base), CK(Key_F,Base), CK(Key_G,Base), CK(Key_C,Base), CK(Key_R,Base), CK(Key_L,Base), CK(Key_Slash,Base),
@@ -75,17 +75,17 @@ ColorKeymaps(
CK(___,Off)),
[FVWM] = KEYMAP_STACKED
- (CK(XXX,Off), CK(Key_BacklightDown,Screen), CK(Key_BacklightUp,Screen), CK(LALT(Key_F1),Lnch), CK(LALT(Key_F2),Lnch), CK(XXX,Off), CK(___,Off),
- CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off),
- CK(LALT(Key_KeypadAdd),Wind), CK(XXX,Off), CK(LALT(Key_Keypad4),Wind), CK(LALT(Key_Keypad2),Wind), CK(LALT(Key_Keypad8),Wind), CK(LALT(Key_Keypad6),Wind),
- CK(LALT(Key_KeypadSubtract),Wind), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(LALT(Key_KeypadMultiply),Wind),
- CK(___,Off), CK(LALT(Key_Backtick),Lnch), CK(LSHIFT(LALT(Key_Backtick)),Lnch), CK(___,Off),
+ (CK(XXX,Off), CK(Key_BacklightDown,Screen), CK(Key_BacklightUp,Screen), CK(Key_F1,Lnch), CK(Key_F2,Lnch), CK(XXX,Off), CK(___,Off),
+ CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(Key_Tab,Wind),
+ CK(Key_KeypadAdd,Wind), CK(XXX,Off), CK(Key_Keypad4,Wind), CK(Key_Keypad2,Wind), CK(Key_Keypad8,Wind), CK(Key_Keypad6,Wind),
+ CK(Key_KeypadSubtract,Wind), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(Key_KeypadMultiply,Wind), CK(___,Off),
+ CK(___,Off), CK(Key_Backtick,Lnch), CK(LSHIFT(Key_Backtick),Lnch), CK(___,Off),
CK(___,Off),
- CK(LALT(Key_W),Wind), CK(Consumer_Mute,Media), CK(Consumer_VolumeDecrement,Media), CK(Consumer_VolumeIncrement,Media), CK(XXX,Off), CK(Consumer_Eject,Media), CK(___,Off),
- CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(LSHIFT(LALT(Key_KeypadDivide)),Wind),
- CK(LALT(Key_LeftArrow),View), CK(LALT(Key_DownArrow),View), CK(LALT(Key_UpArrow),View), CK(LALT(Key_RightArrow),View), CK(XXX,Off), CK(LSHIFT(LALT(Key_KeypadEnter)),Wind),
- CK(LALT(Key_Pause),Lnch), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(LALT(Key_M),Wind), CK(LSHIFT(LALT(Key_KeypadDot)),Wind),
+ CK(Key_W,Wind), CK(Consumer_Mute,Media), CK(Consumer_VolumeDecrement,Media), CK(Consumer_VolumeIncrement,Media), CK(XXX,Off), CK(Consumer_Eject,Media), CK(___,Off),
+ CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(LSHIFT(Key_KeypadDivide),Wind),
+ CK(Key_LeftArrow,View), CK(Key_DownArrow,View), CK(Key_UpArrow,View), CK(Key_RightArrow,View), CK(XXX,Off), CK(LSHIFT(Key_KeypadEnter),Wind),
+ CK(Key_Pause,Lnch), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(XXX,Off), CK(Key_M,Wind), CK(LSHIFT(Key_KeypadDot),Wind),
CK(___,Off), CK(___,Off), CK(___,Off), CK(___,Off),
CK(___,Off))
);
diff --git a/macros.h b/macros.h
index 715d2bc..ce5ec13 100644
--- a/macros.h
+++ b/macros.h
@@ -7,6 +7,7 @@
enum { MACRO_VERSION_INFO,
MACRO_ANY,
MACRO_NUMLOCK,
+ MACRO_FVWM,
};
#ifndef BUILD_INFORMATION
@@ -44,6 +45,16 @@ static void numLockMacro(uint8_t keyState) {
}
}
+static const macro_t *fvwmMacro(uint8_t keyState) {
+ if (keyIsPressed(keyState)) {
+ return MACRO(D(LeftAlt),Dr(ShiftToLayer(FVWM)));
+ }
+ else if (keyWasPressed(keyState)) {
+ return MACRO(Ur(ShiftToLayer(FVWM)),U(LeftAlt));
+ }
+ return MACRO_NONE;
+}
+
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
switch (macroIndex) {
@@ -58,6 +69,10 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
case MACRO_NUMLOCK:
numLockMacro(keyState);
break;
+
+ case MACRO_FVWM:
+ return fvwmMacro(keyState);
+ break;
}
return MACRO_NONE;
}