commit 669348e92ed07e82502e57b5917e365cb341389b
parent ea14873e5acb127fc49be3d31ebe0f9c07999390
Author: minute <lukas@mntre.com>
Date: Fri, 19 Jan 2024 12:45:52 +0000
Merge branch 'feature_swp_ctrl' into 'master'
Add option KBD_SWP_CTRL for swapping Ctrl- and Hyper-Keys.
See merge request reform/reform!54
Diffstat:
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/reform2-keyboard-fw/README.md b/reform2-keyboard-fw/README.md
@@ -58,5 +58,7 @@ standalone keyboard for, define `KBD_MODE_STANDALONE` using
make REFORM_KBD_OPTIONS="-DKBD_VARIANT_3_US -DKBD_MODE_STANDALONE"
make REFORM_KBD_OPTIONS="-DKBD_VARIANT_3 -DKBD_MODE_STANDALONE"
+For keyboard 3 there is also an option to swap Ctrl- and Hyper-Keys: `KBD_SWP_CTRL`.
+
To flash, put your keyboard into [flashing mode](https://mntre.com/reform2/handbook/parts.html#keyboard-firmware) and run:
`sudo ./flash.sh`
diff --git a/reform2-keyboard-fw/matrix_3.h b/reform2-keyboard-fw/matrix_3.h
@@ -6,9 +6,17 @@
#include "keyboard.h"
+#ifdef KBD_SWP_CTRL
+ #define R4_C1 HID_KEYBOARD_SC_EXECUTE
+ #define R6_C1 HID_KEYBOARD_SC_LEFT_CONTROL
+#else
+ #define R4_C1 HID_KEYBOARD_SC_LEFT_CONTROL
+ #define R6_C1 HID_KEYBOARD_SC_EXECUTE
+#endif
+
// Fourth row
#define MATRIX3_DEFAULT_ROW_4 \
- HID_KEYBOARD_SC_LEFT_CONTROL,\
+ R4_C1,\
KEY_A,\
KEY_S,\
KEY_D,\
@@ -25,7 +33,7 @@
// Sixth row
#define MATRIX3_DEFAULT_ROW_6 \
- HID_KEYBOARD_SC_EXECUTE,\
+ R6_C1,\
HID_KEYBOARD_SC_LEFT_GUI,\
HID_KEYBOARD_SC_LEFT_ALT,\
KEY_SPACE,\
@@ -103,7 +111,7 @@ uint8_t matrix_fn[KBD_MATRIX_SZ] = {
HID_KEYBOARD_SC_PAGE_UP,
HID_KEYBOARD_SC_RIGHT_SHIFT,
- HID_KEYBOARD_SC_EXECUTE,
+ R6_C1,
HID_KEYBOARD_SC_LEFT_GUI,
HID_KEYBOARD_SC_LEFT_ALT,
KEY_SPACE,