aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/action.c6
-rw-r--r--quantum/eeconfig.c4
-rw-r--r--quantum/encoder.c4
-rw-r--r--quantum/encoder.h31
-rw-r--r--quantum/encoder/tests/config_mock.h4
-rw-r--r--quantum/encoder/tests/config_mock_split_left_eq_right.h8
-rw-r--r--quantum/encoder/tests/config_mock_split_left_gt_right.h8
-rw-r--r--quantum/encoder/tests/config_mock_split_left_lt_right.h8
-rw-r--r--quantum/encoder/tests/config_mock_split_no_left.h8
-rw-r--r--quantum/encoder/tests/config_mock_split_no_right.h8
-rw-r--r--quantum/encoder/tests/config_mock_split_role.h8
-rw-r--r--quantum/keycode.h8
-rw-r--r--quantum/keycodes.h80
-rw-r--r--quantum/keymap_extras/keymap_farsi.h171
-rw-r--r--quantum/keymap_introspection.c60
-rw-r--r--quantum/keymap_introspection.h46
-rw-r--r--quantum/led.c11
-rw-r--r--quantum/led.h3
-rw-r--r--quantum/matrix.c22
-rw-r--r--quantum/mousekey.c112
-rw-r--r--quantum/painter/qp.h6
-rw-r--r--quantum/painter/qp_internal.c1
-rw-r--r--quantum/painter/rules.mk16
-rw-r--r--quantum/pointing_device/pointing_device.c2
-rw-r--r--quantum/pointing_device/pointing_device_auto_mouse.h2
-rw-r--r--quantum/process_keycode/process_key_override.c10
-rw-r--r--quantum/process_keycode/process_key_override.h5
-rw-r--r--quantum/process_keycode/process_rgb_matrix.c101
-rw-r--r--quantum/process_keycode/process_rgb_matrix.h10
-rw-r--r--quantum/process_keycode/process_tap_dance.c12
-rw-r--r--quantum/process_keycode/process_tap_dance.h4
-rw-r--r--quantum/process_keycode/process_underglow.c91
-rw-r--r--quantum/process_keycode/process_underglow.h10
-rw-r--r--quantum/quantum_keycodes_legacy.h39
-rw-r--r--quantum/repeat_key.c8
-rw-r--r--quantum/rgblight/rgblight_drivers.c8
36 files changed, 741 insertions, 194 deletions
diff --git a/quantum/action.c b/quantum/action.c
index 74ef55e5eb..a39631ba3e 100644
--- a/quantum/action.c
+++ b/quantum/action.c
@@ -329,7 +329,7 @@ void register_mouse(uint8_t mouse_keycode, bool pressed) {
// should mousekeys send report, or does something else handle this?
switch (mouse_keycode) {
# if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE)
- case KC_MS_BTN1 ... KC_MS_BTN8:
+ case QK_MOUSE_BUTTON_1 ... QK_MOUSE_BUTTON_8:
// let pointing device handle the buttons
// expand if/when it handles more of the code
# if defined(POINTING_DEVICE_ENABLE)
@@ -351,8 +351,8 @@ void register_mouse(uint8_t mouse_keycode, bool pressed) {
#ifdef PS2_MOUSE_ENABLE
// make sure that ps2 mouse has button report synced
- if (KC_MS_BTN1 <= mouse_keycode && mouse_keycode <= KC_MS_BTN3) {
- uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - KC_MS_BTN1);
+ if (QK_MOUSE_BUTTON_1 <= mouse_keycode && mouse_keycode <= QK_MOUSE_BUTTON_3) {
+ uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - QK_MOUSE_BUTTON_1);
tp_buttons = pressed ? tp_buttons | tmp_button_msk : tp_buttons & ~tmp_button_msk;
}
#endif
diff --git a/quantum/eeconfig.c b/quantum/eeconfig.c
index 40690d6a97..ffbbf43a95 100644
--- a/quantum/eeconfig.c
+++ b/quantum/eeconfig.c
@@ -46,7 +46,7 @@ __attribute__((weak)) void eeconfig_init_kb(void) {
*/
void eeconfig_init_quantum(void) {
#if defined(EEPROM_DRIVER)
- eeprom_driver_erase();
+ eeprom_driver_format(false);
#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
@@ -108,7 +108,7 @@ void eeconfig_enable(void) {
*/
void eeconfig_disable(void) {
#if defined(EEPROM_DRIVER)
- eeprom_driver_erase();
+ eeprom_driver_format(false);
#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF);
}
diff --git a/quantum/encoder.c b/quantum/encoder.c
index 2ddbf3ee1e..27d7b1fc80 100644
--- a/quantum/encoder.c
+++ b/quantum/encoder.c
@@ -160,7 +160,7 @@ __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) {
# if defined(EXTRAKEY_ENABLE)
tap_code_delay(KC_VOLU, 10);
# elif defined(MOUSEKEY_ENABLE)
- tap_code_delay(KC_MS_WH_UP, 10);
+ tap_code_delay(QK_MOUSE_WHEEL_UP, 10);
# else
tap_code_delay(KC_PGDN, 10);
# endif
@@ -168,7 +168,7 @@ __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) {
# if defined(EXTRAKEY_ENABLE)
tap_code_delay(KC_VOLD, 10);
# elif defined(MOUSEKEY_ENABLE)
- tap_code_delay(KC_MS_WH_DOWN, 10);
+ tap_code_delay(QK_MOUSE_WHEEL_DOWN, 10);
# else
tap_code_delay(KC_PGUP, 10);
# endif
diff --git a/quantum/encoder.h b/quantum/encoder.h
index 317a91f1da..1d2f1f46c7 100644
--- a/quantum/encoder.h
+++ b/quantum/encoder.h
@@ -22,6 +22,21 @@
#include "gpio.h"
#include "util.h"
+// ======== DEPRECATED DEFINES - DO NOT USE ========
+#ifdef ENCODERS_PAD_A
+# define ENCODER_A_PINS ENCODERS_PAD_A
+#endif
+#ifdef ENCODERS_PAD_B
+# define ENCODER_B_PINS ENCODERS_PAD_B
+#endif
+#ifdef ENCODERS_PAD_A_RIGHT
+# define ENCODER_A_PINS_RIGHT ENCODERS_PAD_A_RIGHT
+#endif
+#ifdef ENCODERS_PAD_B_RIGHT
+# define ENCODER_B_PINS_RIGHT ENCODERS_PAD_B_RIGHT
+#endif
+// ========
+
#ifdef ENCODER_ENABLE
__attribute__((weak)) bool should_process_encoder(void);
@@ -36,16 +51,16 @@ bool encoder_update_user(uint8_t index, bool clockwise);
# ifdef SPLIT_KEYBOARD
-# if defined(ENCODERS_PAD_A_RIGHT)
+# if defined(ENCODER_A_PINS_RIGHT)
# ifndef NUM_ENCODERS_LEFT
-# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
+# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS))
# endif
# ifndef NUM_ENCODERS_RIGHT
-# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A_RIGHT))
+# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS_RIGHT))
# endif
# else
# ifndef NUM_ENCODERS_LEFT
-# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
+# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS))
# endif
# ifndef NUM_ENCODERS_RIGHT
# define NUM_ENCODERS_RIGHT NUM_ENCODERS_LEFT
@@ -58,19 +73,13 @@ bool encoder_update_user(uint8_t index, bool clockwise);
# else // SPLIT_KEYBOARD
# ifndef NUM_ENCODERS
-# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
+# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODER_A_PINS))
# endif
# define NUM_ENCODERS_LEFT NUM_ENCODERS
# define NUM_ENCODERS_RIGHT 0
# endif // SPLIT_KEYBOARD
-# ifndef NUM_ENCODERS
-# define NUM_ENCODERS 0
-# define NUM_ENCODERS_LEFT 0
-# define NUM_ENCODERS_RIGHT 0
-# endif // NUM_ENCODERS
-
# define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
# ifndef MAX_QUEUED_ENCODER_EVENTS
diff --git a/quantum/encoder/tests/config_mock.h b/quantum/encoder/tests/config_mock.h
index 9eb59ddc88..b5a1537d8a 100644
--- a/quantum/encoder/tests/config_mock.h
+++ b/quantum/encoder/tests/config_mock.h
@@ -7,9 +7,9 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{ 0 }
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{ 1 }
#ifdef __cplusplus
diff --git a/quantum/encoder/tests/config_mock_split_left_eq_right.h b/quantum/encoder/tests/config_mock_split_left_eq_right.h
index ea795657ef..a4aa051ef1 100644
--- a/quantum/encoder/tests/config_mock_split_left_eq_right.h
+++ b/quantum/encoder/tests/config_mock_split_left_eq_right.h
@@ -7,13 +7,13 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{ 0, 2 }
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{ 1, 3 }
-#define ENCODERS_PAD_A_RIGHT \
+#define ENCODER_A_PINS_RIGHT \
{ 4, 6 }
-#define ENCODERS_PAD_B_RIGHT \
+#define ENCODER_B_PINS_RIGHT \
{ 5, 7 }
#ifdef __cplusplus
diff --git a/quantum/encoder/tests/config_mock_split_left_gt_right.h b/quantum/encoder/tests/config_mock_split_left_gt_right.h
index abcfe03918..77190797ad 100644
--- a/quantum/encoder/tests/config_mock_split_left_gt_right.h
+++ b/quantum/encoder/tests/config_mock_split_left_gt_right.h
@@ -7,13 +7,13 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{ 0, 2, 4 }
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{ 1, 3, 5 }
-#define ENCODERS_PAD_A_RIGHT \
+#define ENCODER_A_PINS_RIGHT \
{ 6, 8 }
-#define ENCODERS_PAD_B_RIGHT \
+#define ENCODER_B_PINS_RIGHT \
{ 7, 9 }
#ifdef __cplusplus
diff --git a/quantum/encoder/tests/config_mock_split_left_lt_right.h b/quantum/encoder/tests/config_mock_split_left_lt_right.h
index 075c774b0d..61808e866e 100644
--- a/quantum/encoder/tests/config_mock_split_left_lt_right.h
+++ b/quantum/encoder/tests/config_mock_split_left_lt_right.h
@@ -7,13 +7,13 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{ 0, 2 }
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{ 1, 3 }
-#define ENCODERS_PAD_A_RIGHT \
+#define ENCODER_A_PINS_RIGHT \
{ 4, 6, 8 }
-#define ENCODERS_PAD_B_RIGHT \
+#define ENCODER_B_PINS_RIGHT \
{ 5, 7, 9 }
#ifdef __cplusplus
diff --git a/quantum/encoder/tests/config_mock_split_no_left.h b/quantum/encoder/tests/config_mock_split_no_left.h
index dfd8358929..599e584ff1 100644
--- a/quantum/encoder/tests/config_mock_split_no_left.h
+++ b/quantum/encoder/tests/config_mock_split_no_left.h
@@ -7,13 +7,13 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{}
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{}
-#define ENCODERS_PAD_A_RIGHT \
+#define ENCODER_A_PINS_RIGHT \
{ 0, 2 }
-#define ENCODERS_PAD_B_RIGHT \
+#define ENCODER_B_PINS_RIGHT \
{ 1, 3 }
#ifdef __cplusplus
diff --git a/quantum/encoder/tests/config_mock_split_no_right.h b/quantum/encoder/tests/config_mock_split_no_right.h
index 5683eade8c..c3f753014c 100644
--- a/quantum/encoder/tests/config_mock_split_no_right.h
+++ b/quantum/encoder/tests/config_mock_split_no_right.h
@@ -7,13 +7,13 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{ 0, 2 }
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{ 1, 3 }
-#define ENCODERS_PAD_A_RIGHT \
+#define ENCODER_A_PINS_RIGHT \
{}
-#define ENCODERS_PAD_B_RIGHT \
+#define ENCODER_B_PINS_RIGHT \
{}
#ifdef __cplusplus
diff --git a/quantum/encoder/tests/config_mock_split_role.h b/quantum/encoder/tests/config_mock_split_role.h
index ea795657ef..a4aa051ef1 100644
--- a/quantum/encoder/tests/config_mock_split_role.h
+++ b/quantum/encoder/tests/config_mock_split_role.h
@@ -7,13 +7,13 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
-#define ENCODERS_PAD_A \
+#define ENCODER_A_PINS \
{ 0, 2 }
-#define ENCODERS_PAD_B \
+#define ENCODER_B_PINS \
{ 1, 3 }
-#define ENCODERS_PAD_A_RIGHT \
+#define ENCODER_A_PINS_RIGHT \
{ 4, 6 }
-#define ENCODERS_PAD_B_RIGHT \
+#define ENCODER_B_PINS_RIGHT \
{ 5, 7 }
#ifdef __cplusplus
diff --git a/quantum/keycode.h b/quantum/keycode.h
index df1452d296..4ff6894a01 100644
--- a/quantum/keycode.h
+++ b/quantum/keycode.h
@@ -29,10 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF)
#define IS_MOUSEKEY(code) IS_MOUSE_KEYCODE(code)
-#define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT)
-#define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN8)
-#define IS_MOUSEKEY_WHEEL(code) (KC_MS_WH_UP <= (code) && (code) <= KC_MS_WH_RIGHT)
-#define IS_MOUSEKEY_ACCEL(code) (KC_MS_ACCEL0 <= (code) && (code) <= KC_MS_ACCEL2)
+#define IS_MOUSEKEY_MOVE(code) (QK_MOUSE_CURSOR_UP <= (code) && (code) <= QK_MOUSE_CURSOR_RIGHT)
+#define IS_MOUSEKEY_BUTTON(code) (QK_MOUSE_BUTTON_1 <= (code) && (code) <= QK_MOUSE_BUTTON_8)
+#define IS_MOUSEKEY_WHEEL(code) (QK_MOUSE_WHEEL_UP <= (code) && (code) <= QK_MOUSE_WHEEL_RIGHT)
+#define IS_MOUSEKEY_ACCEL(code) (QK_MOUSE_ACCELERATION_0 <= (code) && (code) <= QK_MOUSE_ACCELERATION_2)
#define MOD_BIT(code) (1 << ((code)&0x07))
diff --git a/quantum/keycodes.h b/quantum/keycodes.h
index c92028ab43..f461e4a586 100644
--- a/quantum/keycodes.h
+++ b/quantum/keycodes.h
@@ -283,25 +283,25 @@ enum qk_keycode_defines {
KC_ASSISTANT = 0x00C0,
KC_MISSION_CONTROL = 0x00C1,
KC_LAUNCHPAD = 0x00C2,
- KC_MS_UP = 0x00CD,
- KC_MS_DOWN = 0x00CE,
- KC_MS_LEFT = 0x00CF,
- KC_MS_RIGHT = 0x00D0,
- KC_MS_BTN1 = 0x00D1,
- KC_MS_BTN2 = 0x00D2,
- KC_MS_BTN3 = 0x00D3,
- KC_MS_BTN4 = 0x00D4,
- KC_MS_BTN5 = 0x00D5,
- KC_MS_BTN6 = 0x00D6,
- KC_MS_BTN7 = 0x00D7,
- KC_MS_BTN8 = 0x00D8,
- KC_MS_WH_UP = 0x00D9,
- KC_MS_WH_DOWN = 0x00DA,
- KC_MS_WH_LEFT = 0x00DB,
- KC_MS_WH_RIGHT = 0x00DC,
- KC_MS_ACCEL0 = 0x00DD,
- KC_MS_ACCEL1 = 0x00DE,
- KC_MS_ACCEL2 = 0x00DF,
+ QK_MOUSE_CURSOR_UP = 0x00CD,
+ QK_MOUSE_CURSOR_DOWN = 0x00CE,
+ QK_MOUSE_CURSOR_LEFT = 0x00CF,
+ QK_MOUSE_CURSOR_RIGHT = 0x00D0,
+ QK_MOUSE_BUTTON_1 = 0x00D1,
+ QK_MOUSE_BUTTON_2 = 0x00D2,
+ QK_MOUSE_BUTTON_3 = 0x00D3,
+ QK_MOUSE_BUTTON_4 = 0x00D4,
+ QK_MOUSE_BUTTON_5 = 0x00D5,
+ QK_MOUSE_BUTTON_6 = 0x00D6,
+ QK_MOUSE_BUTTON_7 = 0x00D7,
+ QK_MOUSE_BUTTON_8 = 0x00D8,
+ QK_MOUSE_WHEEL_UP = 0x00D9,
+ QK_MOUSE_WHEEL_DOWN = 0x00DA,
+ QK_MOUSE_WHEEL_LEFT = 0x00DB,
+ QK_MOUSE_WHEEL_RIGHT = 0x00DC,
+ QK_MOUSE_ACCELERATION_0 = 0x00DD,
+ QK_MOUSE_ACCELERATION_1 = 0x00DE,
+ QK_MOUSE_ACCELERATION_2 = 0x00DF,
KC_LEFT_CTRL = 0x00E0,
KC_LEFT_SHIFT = 0x00E1,
KC_LEFT_ALT = 0x00E2,
@@ -926,25 +926,25 @@ enum qk_keycode_defines {
KC_ASST = KC_ASSISTANT,
KC_MCTL = KC_MISSION_CONTROL,
KC_LPAD = KC_LAUNCHPAD,
- KC_MS_U = KC_MS_UP,
- KC_MS_D = KC_MS_DOWN,
- KC_MS_L = KC_MS_LEFT,
- KC_MS_R = KC_MS_RIGHT,
- KC_BTN1 = KC_MS_BTN1,
- KC_BTN2 = KC_MS_BTN2,
- KC_BTN3 = KC_MS_BTN3,
- KC_BTN4 = KC_MS_BTN4,
- KC_BTN5 = KC_MS_BTN5,
- KC_BTN6 = KC_MS_BTN6,
- KC_BTN7 = KC_MS_BTN7,
- KC_BTN8 = KC_MS_BTN8,
- KC_WH_U = KC_MS_WH_UP,
- KC_WH_D = KC_MS_WH_DOWN,
- KC_WH_L = KC_MS_WH_LEFT,
- KC_WH_R = KC_MS_WH_RIGHT,
- KC_ACL0 = KC_MS_ACCEL0,
- KC_ACL1 = KC_MS_ACCEL1,
- KC_ACL2 = KC_MS_ACCEL2,
+ MS_UP = QK_MOUSE_CURSOR_UP,
+ MS_DOWN = QK_MOUSE_CURSOR_DOWN,
+ MS_LEFT = QK_MOUSE_CURSOR_LEFT,
+ MS_RGHT = QK_MOUSE_CURSOR_RIGHT,
+ MS_BTN1 = QK_MOUSE_BUTTON_1,
+ MS_BTN2 = QK_MOUSE_BUTTON_2,
+ MS_BTN3 = QK_MOUSE_BUTTON_3,
+ MS_BTN4 = QK_MOUSE_BUTTON_4,
+ MS_BTN5 = QK_MOUSE_BUTTON_5,
+ MS_BTN6 = QK_MOUSE_BUTTON_6,
+ MS_BTN7 = QK_MOUSE_BUTTON_7,
+ MS_BTN8 = QK_MOUSE_BUTTON_8,
+ MS_WHLU = QK_MOUSE_WHEEL_UP,
+ MS_WHLD = QK_MOUSE_WHEEL_DOWN,
+ MS_WHLL = QK_MOUSE_WHEEL_LEFT,
+ MS_WHLR = QK_MOUSE_WHEEL_RIGHT,
+ MS_ACL0 = QK_MOUSE_ACCELERATION_0,
+ MS_ACL1 = QK_MOUSE_ACCELERATION_1,
+ MS_ACL2 = QK_MOUSE_ACCELERATION_2,
KC_LCTL = KC_LEFT_CTRL,
KC_LSFT = KC_LEFT_SHIFT,
KC_LALT = KC_LEFT_ALT,
@@ -1457,7 +1457,7 @@ enum qk_keycode_defines {
#define IS_BASIC_KEYCODE(code) ((code) >= KC_A && (code) <= KC_EXSEL)
#define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE)
#define IS_CONSUMER_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_LAUNCHPAD)
-#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2)
+#define IS_MOUSE_KEYCODE(code) ((code) >= QK_MOUSE_CURSOR_UP && (code) <= QK_MOUSE_ACCELERATION_2)
#define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI)
#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT)
#define IS_MAGIC_KEYCODE(code) ((code) >= QK_MAGIC_SWAP_CONTROL_CAPS_LOCK && (code) <= QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK)
@@ -1482,7 +1482,7 @@ enum qk_keycode_defines {
#define BASIC_KEYCODE_RANGE KC_A ... KC_EXSEL
#define SYSTEM_KEYCODE_RANGE KC_SYSTEM_POWER ... KC_SYSTEM_WAKE
#define CONSUMER_KEYCODE_RANGE KC_AUDIO_MUTE ... KC_LAUNCHPAD
-#define MOUSE_KEYCODE_RANGE KC_MS_UP ... KC_MS_ACCEL2
+#define MOUSE_KEYCODE_RANGE QK_MOUSE_CURSOR_UP ... QK_MOUSE_ACCELERATION_2
#define MODIFIER_KEYCODE_RANGE KC_LEFT_CTRL ... KC_RIGHT_GUI
#define SWAP_HANDS_KEYCODE_RANGE QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT
#define MAGIC_KEYCODE_RANGE QK_MAGIC_SWAP_CONTROL_CAPS_LOCK ... QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK
diff --git a/quantum/keymap_extras/keymap_farsi.h b/quantum/keymap_extras/keymap_farsi.h
new file mode 100644
index 0000000000..d268917513
--- /dev/null
+++ b/quantum/keymap_extras/keymap_farsi.h
@@ -0,0 +1,171 @@
+// Copyright 2024 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/*******************************************************************************
+ 88888888888 888 d8b .d888 d8b 888 d8b
+ 888 888 Y8P d88P" Y8P 888 Y8P
+ 888 888 888 888
+ 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b
+ 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K
+ 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b.
+ 888 888 888 888 X88 888 888 888 Y8b. 888 X88
+ 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P'
+ 888 888
+ 888 888
+ 888 888
+ .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888
+ d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888
+ 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888
+ Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888
+ "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888
+ 888
+ Y8b d88P
+ "Y88P"
+*******************************************************************************/
+
+#pragma once
+#include "keycodes.h"
+// clang-format off
+
+// Aliases
+#define FA_ZWJ KC_GRV // (zero-width joiner)
+#define FA_1A KC_1 // ۱
+#define FA_2A KC_2 // ۲
+#define FA_3A KC_3 // ۳
+#define FA_4A KC_4 // ۴
+#define FA_5A KC_5 // ۵
+#define FA_6A KC_6 // ۶
+#define FA_7A KC_7 // ۷
+#define FA_8A KC_8 // ۸
+#define FA_9A KC_9 // ۹
+#define FA_0A KC_0 // ۰
+#define FA_MINS KC_MINS // -
+#define FA_EQL KC_EQL // =
+#define FA_ZAD KC_Q // ض
+#define FA_SAD KC_W // ص
+#define FA_SE KC_E // ث
+#define FA_QAF KC_R // ق
+#define FA_FE KC_T // ف
+#define FA_GHYN KC_Y // غ
+#define FA_EYN KC_U // ع
+#define FA_HE KC_I // ه
+#define FA_KHE KC_O // خ
+#define FA_HEJ KC_P // ح
+#define FA_JIM KC_LBRC // ج
+#define FA_CHE KC_RBRC // چ
+#define FA_SHIN KC_A // ش
+#define FA_SIN KC_S // س
+#define FA_YE KC_D // ی
+#define FA_BE KC_F // ب
+#define FA_LAM KC_G // ل
+#define FA_ALEF KC_H // ا
+#define FA_TE KC_J // ت
+#define FA_NOON KC_K // ن
+#define FA_MIM KC_L // م
+#define FA_KAF KC_SCLN // ک
+#define FA_GAF KC_QUOT // گ
+#define FA_BSLS KC_BSLS // (backslash)
+#define FA_LT KC_LT // <
+#define FA_ZA KC_Z // ظ
+#define FA_TA KC_X // ط
+#define FA_ZE KC_C // ز
+#define FA_RE KC_V // ر
+#define FA_ZAL KC_B // ذ
+#define FA_DAL KC_N // د
+#define FA_PE KC_M // پ
+#define FA_WAW KC_COMM // و
+#define FA_DOT KC_DOT // .
+#define FA_SLSH KC_SLSH // /
+#define FA_SPC KC_SPC //
+#define FA_DIV S(FA_ZWJ) // ÷
+#define FA_EXLM S(FA_1A) // !
+#define FA_THS S(FA_2A) // ٬
+#define FA_DECS S(FA_3A) // ٫
+#define FA_RIAL S(FA_4A) // ﷼
+#define FA_PRCA S(FA_5A) // ٪
+#define FA_MUL S(FA_6A) // ×
+#define FA_COMA S(FA_7A) // ،
+#define FA_ASTR S(FA_8A) // *
+#define FA_RPRN S(FA_9A) // )
+#define FA_LPRN S(FA_0A) // (
+#define FA_TATW S(FA_MINS) // ـ
+#define FA_PLUS S(FA_EQL) // +
+#define FA_SUK S(FA_ZAD) // ْ
+#define FA_DMTN S(FA_SAD) // ٌ
+#define FA_KSTN S(FA_SE) // ٍ
+#define FA_FTHN S(FA_QAF) // ً
+#define FA_DMM S(FA_FE) // ُ
+#define FA_KAS S(FA_GHYN) // ِ
+#define FA_FAT S(FA_EYN) // َ
+#define FA_TSDD S(FA_HE) //
+#define FA_RBRC S(FA_KHE) // ]
+#define FA_LBRC S(FA_HEJ) // [
+#define FA_RCBR S(FA_JIM) // }
+#define FA_LCBR S(FA_CHE) // {
+#define FA_HMZV S(FA_SHIN) // ؤ
+#define FA_HMZY S(FA_SIN) // ئ
+#define FA_YEA S(FA_YE) // ي
+#define FA_HMZU S(FA_BE) // إ
+#define FA_HMZO S(FA_LAM) // أ
+#define FA_MALF S(FA_ALEF) // آ
+#define FA_TEHM S(FA_TE) // ة
+#define FA_RQOT S(FA_NOON) // »
+#define FA_LQOT S(FA_MIM) // «
+#define FA_COLN S(FA_KAF) // :
+#define FA_SCLA S(FA_GAF) // ؛
+#define FA_GT S(FA_LT) // >
+#define FA_KAFA S(FA_ZA) // ك
+#define FA_MADO S(FA_TA) // ٓ
+#define FA_JEH S(FA_ZE) // ژ
+#define FA_SUPA S(FA_RE) // ٰ
+#define FA_ZWNJ S(FA_ZAL) // (zero-width non-joiner)
+#define FA_HMZA S(FA_DAL) // ٔ
+#define FA_HMZ S(FA_PE) // ء
+#define FA_QSA S(FA_SLSH) // ؟
+#define FA_TILD ALGR(FA_ZWJ) // ~
+#define FA_GRV ALGR(FA_1A) // `
+#define FA_AT ALGR(FA_2A) // @
+#define FA_HASH ALGR(FA_3A) // #
+#define FA_DLR ALGR(FA_4A) // $
+#define FA_PERC ALGR(FA_5A) // %
+#define FA_CIRC ALGR(FA_6A) // ^
+#define FA_AMPR ALGR(FA_7A) // &
+#define FA_BULT ALGR(FA_8A) // •
+#define FA_LRM ALGR(FA_9A) // (left-to-right mark)
+#define FA_RLM ALGR(FA_0A) // (right-to-left mark)
+#define FA_UNDS ALGR(FA_MINS) // _
+#define FA_DMNS ALGR(FA_EQL) // − (dead)
+#define FA_DEG ALGR(FA_ZAD) // °
+#define FA_EURO ALGR(FA_SE) // €
+#define FA_LRO ALGR(FA_HE) // (left-to-right override)
+#define FA_RLO ALGR(FA_KHE) // (right-to-left override)
+#define FA_PDF ALGR(FA_HEJ) // (pop directional formatting)
+#define FA_LRE ALGR(FA_JIM) // (left-to-right embedding)
+#define FA_RLE ALGR(FA_CHE) // (right-to-left embedding)
+#define FA_ALFM ALGR(FA_YE) // ى
+#define FA_ALFW ALGR(FA_ALEF) // ٱ
+#define FA_LORP ALGR(FA_NOON) // ﴾
+#define FA_RORP ALGR(FA_MIM) // ﴿
+#define FA_SCLN ALGR(FA_KAF) // ;
+#define FA_DQT ALGR(FA_GAF) // "
+#define FA_MINA ALGR(FA_BSLS) // -
+#define FA_PIPE ALGR(FA_ZA) // |
+#define FA_SUBA ALGR(FA_RA) // ٖ
+#define FA_HMZB ALGR(FA_DAL) // ء
+#define FA_ELLP ALGR(FA_PE) // …
+#define FA_COMM ALGR(FA_WAW) // ,
+#define FA_QUOT ALGR(FA_DOT) // '
+#define FA_QUES ALGR(FA_SLSH) // ?
+#define FA_1 S(ALGR(FA_1A)) // 1
+#define FA_2 S(ALGR(FA_2A)) // 2
+#define FA_3 S(ALGR(FA_3A)) // 3
+#define FA_4 S(ALGR(FA_4A)) // 4
+#define FA_5 S(ALGR(FA_5A)) // 5
+#define FA_6 S(ALGR(FA_6A)) // 6
+#define FA_7 S(ALGR(FA_7A)) // 7
+#define FA_8 S(ALGR(FA_8A)) // 8
+#define FA_9 S(ALGR(FA_9A)) // 9
+#define FA_0 S(ALGR(FA_0A)) // 0
+#define FA_BRKP S(ALGR(FA_LT)) // ¦
+#define FA_NNBS S(ALGR(FA_SPC)) // (narrow non-breaking space)
+
diff --git a/quantum/keymap_introspection.c b/quantum/keymap_introspection.c
index 71e3b429ea..327df6e277 100644
--- a/quantum/keymap_introspection.c
+++ b/quantum/keymap_introspection.c
@@ -10,6 +10,7 @@
#endif // INTROSPECTION_KEYMAP_C
#include "keymap_introspection.h"
+#include "util.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Key mapping
@@ -83,7 +84,7 @@ uint16_t keycode_at_dip_switch_map_location_raw(uint8_t switch_idx, bool on) {
return KC_TRNS;
}
-uint16_t keycode_at_dip_switch_map_location(uint8_t switch_idx, bool on) {
+__attribute__((weak)) uint16_t keycode_at_dip_switch_map_location(uint8_t switch_idx, bool on) {
return keycode_at_dip_switch_map_location_raw(switch_idx, on);
}
@@ -95,13 +96,16 @@ uint16_t keycode_at_dip_switch_map_location(uint8_t switch_idx, bool on) {
#if defined(COMBO_ENABLE)
uint16_t combo_count_raw(void) {
- return sizeof(key_combos) / sizeof(combo_t);
+ return ARRAY_SIZE(key_combos);
}
__attribute__((weak)) uint16_t combo_count(void) {
return combo_count_raw();
}
combo_t* combo_get_raw(uint16_t combo_idx) {
+ if (combo_idx >= combo_count_raw()) {
+ return NULL;
+ }
return &key_combos[combo_idx];
}
__attribute__((weak)) combo_t* combo_get(uint16_t combo_idx) {
@@ -109,3 +113,55 @@ __attribute__((weak)) combo_t* combo_get(uint16_t combo_idx) {
}
#endif // defined(COMBO_ENABLE)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Tap Dance
+
+#if defined(TAP_DANCE_ENABLE)
+
+uint16_t tap_dance_count_raw(void) {
+ return ARRAY_SIZE(tap_dance_actions);
+}
+
+__attribute__((weak)) uint16_t tap_dance_count(void) {
+ return tap_dance_count_raw();
+}
+
+tap_dance_action_t* tap_dance_get_raw(uint16_t tap_dance_idx) {
+ if (tap_dance_idx >= tap_dance_count_raw()) {
+ return NULL;
+ }
+ return &tap_dance_actions[tap_dance_idx];
+}
+
+__attribute__((weak)) tap_dance_action_t* tap_dance_get(uint16_t tap_dance_idx) {
+ return tap_dance_get_raw(tap_dance_idx);
+}
+
+#endif // defined(TAP_DANCE_ENABLE)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Key Overrides
+
+#if defined(KEY_OVERRIDE_ENABLE)
+
+uint16_t key_override_count_raw(void) {
+ return ARRAY_SIZE(key_overrides);
+}
+
+__attribute__((weak)) uint16_t key_override_count(void) {
+ return key_override_count_raw();
+}
+
+const key_override_t* key_override_get_raw(uint16_t key_override_idx) {
+ if (key_override_idx >= key_override_count_raw()) {
+ return NULL;
+ }
+ return key_overrides[key_override_idx];
+}
+
+__attribute__((weak)) const key_override_t* key_override_get(uint16_t key_override_idx) {
+ return key_override_get_raw(key_override_idx);
+}
+
+#endif // defined(KEY_OVERRIDE_ENABLE)
diff --git a/quantum/keymap_introspection.h b/quantum/keymap_introspection.h
index f7516bf42a..719825c674 100644
--- a/quantum/keymap_introspection.h
+++ b/quantum/keymap_introspection.h
@@ -61,9 +61,51 @@ uint16_t combo_count_raw(void);
// Get the number of combos defined in the user's keymap, potentially stored dynamically
uint16_t combo_count(void);
-// Get the keycode for the encoder mapping location, stored in firmware rather than any other persistent storage
+// Get the combo definition, stored in firmware rather than any other persistent storage
combo_t* combo_get_raw(uint16_t combo_idx);
-// Get the keycode for the encoder mapping location, potentially stored dynamically
+// Get the combo definition, potentially stored dynamically
combo_t* combo_get(uint16_t combo_idx);
#endif // defined(COMBO_ENABLE)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Tap Dance
+
+#if defined(TAP_DANCE_ENABLE)
+
+// Forward declaration of tap_dance_action_t so we don't need to deal with header reordering
+struct tap_dance_action_t;
+typedef struct tap_dance_action_t tap_dance_action_t;
+
+// Get the number of tap dances defined in the user's keymap, stored in firmware rather than any other persistent storage
+uint16_t tap_dance_count_raw(void);
+// Get the number of tap dances defined in the user's keymap, potentially stored dynamically
+uint16_t tap_dance_count(void);
+
+// Get the tap dance definitions, stored in firmware rather than any other persistent storage
+tap_dance_action_t* tap_dance_get_raw(uint16_t tap_dance_idx);
+// Get the tap dance definitions, potentially stored dynamically
+tap_dance_action_t* tap_dance_get(uint16_t tap_dance_idx);
+
+#endif // defined(TAP_DANCE_ENABLE)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Key Overrides
+
+#if defined(KEY_OVERRIDE_ENABLE)
+
+// Forward declaration of key_override_t so we don't need to deal with header reordering
+struct key_override_t;
+typedef struct key_override_t key_override_t;
+
+// Get the number of key overrides defined in the user's keymap, stored in firmware rather than any other persistent storage
+uint16_t key_override_count_raw(void);
+// Get the number of key overrides defined in the user's keymap, potentially stored dynamically
+uint16_t key_override_count(void);
+
+// Get the key override definitions, stored in firmware rather than any other persistent storage
+const key_override_t* key_override_get_raw(uint16_t key_override_idx);
+// Get the key override definitions, potentially stored dynamically
+const key_override_t* key_override_get(uint16_t key_override_idx);
+
+#endif // defined(KEY_OVERRIDE_ENABLE)
diff --git a/quantum/led.c b/quantum/led.c
index e2b5985109..aec3edc823 100644
--- a/quantum/led.c
+++ b/quantum/led.c
@@ -56,19 +56,15 @@ static void handle_backlight_caps_lock(led_t led_state) {
#endif
static uint32_t last_led_modification_time = 0;
-uint32_t last_led_activity_time(void) {
+
+uint32_t last_led_activity_time(void) {
return last_led_modification_time;
}
+
uint32_t last_led_activity_elapsed(void) {
return timer_elapsed32(last_led_modification_time);
}
-/** \brief Lock LED set callback - keymap/user level
- *
- * \deprecated Use led_update_user() instead.
- */
-__attribute__((weak)) void led_set_user(uint8_t usb_led) {}
-
/** \brief Lock LED update callback - keymap/user level
*
* \return True if led_update_kb() should run its own code, false otherwise.
@@ -146,7 +142,6 @@ __attribute__((weak)) void led_set(uint8_t usb_led) {
handle_backlight_caps_lock((led_t)usb_led);
#endif
- led_set_user(usb_led);
led_update_kb((led_t)usb_led);
}
diff --git a/quantum/led.h b/quantum/led.h
index b9fad670ae..669e93e194 100644
--- a/quantum/led.h
+++ b/quantum/led.h
@@ -48,9 +48,6 @@ void led_wakeup(void);
void led_task(void);
-/* Deprecated callbacks */
-void led_set_user(uint8_t usb_led);
-
/* Callbacks */
bool led_update_user(led_t led_state);
bool led_update_kb(led_t led_state);
diff --git a/quantum/matrix.c b/quantum/matrix.c
index d4586efac2..a877fb4e41 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -76,21 +76,21 @@ __attribute__((weak)) void matrix_init_pins(void);
__attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
__attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter);
-static inline void setPinOutput_writeLow(pin_t pin) {
+static inline void gpio_atomic_set_pin_output_low(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
gpio_set_pin_output(pin);
gpio_write_pin_low(pin);
}
}
-static inline void setPinOutput_writeHigh(pin_t pin) {
+static inline void gpio_atomic_set_pin_output_high(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
gpio_set_pin_output(pin);
gpio_write_pin_high(pin);
}
}
-static inline void setPinInputHigh_atomic(pin_t pin) {
+static inline void gpio_atomic_set_pin_input_high(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
gpio_set_pin_input_high(pin);
}
@@ -140,7 +140,7 @@ __attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[]
static bool select_row(uint8_t row) {
pin_t pin = row_pins[row];
if (pin != NO_PIN) {
- setPinOutput_writeLow(pin);
+ gpio_atomic_set_pin_output_low(pin);
return true;
}
return false;
@@ -150,9 +150,9 @@ static void unselect_row(uint8_t row) {
pin_t pin = row_pins[row];
if (pin != NO_PIN) {
# ifdef MATRIX_UNSELECT_DRIVE_HIGH
- setPinOutput_writeHigh(pin);
+ gpio_atomic_set_pin_output_high(pin);
# else
- setPinInputHigh_atomic(pin);
+ gpio_atomic_set_pin_input_high(pin);
# endif
}
}
@@ -167,7 +167,7 @@ __attribute__((weak)) void matrix_init_pins(void) {
unselect_rows();
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
if (col_pins[x] != NO_PIN) {
- setPinInputHigh_atomic(col_pins[x]);
+ gpio_atomic_set_pin_input_high(col_pins[x]);
}
}
}
@@ -203,7 +203,7 @@ __attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[]
static bool select_col(uint8_t col) {
pin_t pin = col_pins[col];
if (pin != NO_PIN) {
- setPinOutput_writeLow(pin);
+ gpio_atomic_set_pin_output_low(pin);
return true;
}
return false;
@@ -213,9 +213,9 @@ static void unselect_col(uint8_t col) {
pin_t pin = col_pins[col];
if (pin != NO_PIN) {
# ifdef MATRIX_UNSELECT_DRIVE_HIGH
- setPinOutput_writeHigh(pin);
+ gpio_atomic_set_pin_output_high(pin);
# else
- setPinInputHigh_atomic(pin);
+ gpio_atomic_set_pin_input_high(pin);
# endif
}
}
@@ -230,7 +230,7 @@ __attribute__((weak)) void matrix_init_pins(void) {
unselect_cols();
for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
if (row_pins[x] != NO_PIN) {
- setPinInputHigh_atomic(row_pins[x]);
+ gpio_atomic_set_pin_input_high(row_pins[x]);
}
}
}
diff --git a/quantum/mousekey.c b/quantum/mousekey.c
index 3910811752..8683cfdffa 100644
--- a/quantum/mousekey.c
+++ b/quantum/mousekey.c
@@ -407,42 +407,42 @@ void mousekey_on(uint8_t code) {
# ifdef MOUSEKEY_INERTIA
// initial keypress sets impulse and activates first frame of movement
- if ((code == KC_MS_UP) || (code == KC_MS_DOWN)) {
- mousekey_y_dir = (code == KC_MS_DOWN) ? 1 : -1;
+ if ((code == QK_MOUSE_CURSOR_UP) || (code == QK_MOUSE_CURSOR_DOWN)) {
+ mousekey_y_dir = (code == QK_MOUSE_CURSOR_DOWN) ? 1 : -1;
if (mousekey_frame < 2) mouse_report.y = move_unit(1);
- } else if ((code == KC_MS_LEFT) || (code == KC_MS_RIGHT)) {
- mousekey_x_dir = (code == KC_MS_RIGHT) ? 1 : -1;
+ } else if ((code == QK_MOUSE_CURSOR_LEFT) || (code == QK_MOUSE_CURSOR_RIGHT)) {
+ mousekey_x_dir = (code == QK_MOUSE_CURSOR_RIGHT) ? 1 : -1;
if (mousekey_frame < 2) mouse_report.x = move_unit(0);
}
# else // no inertia
- if (code == KC_MS_UP)
+ if (code == QK_MOUSE_CURSOR_UP)
mouse_report.y = move_unit() * -1;
- else if (code == KC_MS_DOWN)
+ else if (code == QK_MOUSE_CURSOR_DOWN)
mouse_report.y = move_unit();
- else if (code == KC_MS_LEFT)
+ else if (code == QK_MOUSE_CURSOR_LEFT)
mouse_report.x = move_unit() * -1;
- else if (code == KC_MS_RIGHT)
+ else if (code == QK_MOUSE_CURSOR_RIGHT)
mouse_report.x = move_unit();
# endif // inertia or not
- else if (code == KC_MS_WH_UP)
+ else if (code == QK_MOUSE_WHEEL_UP)
mouse_report.v = wheel_unit();
- else if (code == KC_MS_WH_DOWN)
+ else if (code == QK_MOUSE_WHEEL_DOWN)
mouse_report.v = wheel_unit() * -1;
- else if (code == KC_MS_WH_LEFT)
+ else if (code == QK_MOUSE_WHEEL_LEFT)
mouse_report.h = wheel_unit() * -1;
- else if (code == KC_MS_WH_RIGHT)
+ else if (code == QK_MOUSE_WHEEL_RIGHT)
mouse_report.h = wheel_unit();
else if (IS_MOUSEKEY_BUTTON(code))
- mouse_report.buttons |= 1 << (code - KC_MS_BTN1);
- else if (code == KC_MS_ACCEL0)
+ mouse_report.buttons |= 1 << (code - QK_MOUSE_BUTTON_1);
+ else if (code == QK_MOUSE_ACCELERATION_0)
mousekey_accel |= (1 << 0);
- else if (code == KC_MS_ACCEL1)
+ else if (code == QK_MOUSE_ACCELERATION_1)
mousekey_accel |= (1 << 1);
- else if (code == KC_MS_ACCEL2)
+ else if (code == QK_MOUSE_ACCELERATION_2)
mousekey_accel |= (1 << 2);
}
@@ -450,43 +450,43 @@ void mousekey_off(uint8_t code) {
# ifdef MOUSEKEY_INERTIA
// key release clears impulse unless opposite direction is held
- if ((code == KC_MS_UP) && (mousekey_y_dir < 1))
+ if ((code == QK_MOUSE_CURSOR_UP) && (mousekey_y_dir < 1))
mousekey_y_dir = 0;
- else if ((code == KC_MS_DOWN) && (mousekey_y_dir > -1))
+ else if ((code == QK_MOUSE_CURSOR_DOWN) && (mousekey_y_dir > -1))
mousekey_y_dir = 0;
- else if ((code == KC_MS_LEFT) && (mousekey_x_dir < 1))
+ else if ((code == QK_MOUSE_CURSOR_LEFT) && (mousekey_x_dir < 1))
mousekey_x_dir = 0;
- else if ((code == KC_MS_RIGHT) && (mousekey_x_dir > -1))
+ else if ((code == QK_MOUSE_CURSOR_RIGHT) && (mousekey_x_dir > -1))
mousekey_x_dir = 0;
# else // no inertia
- if (code == KC_MS_UP && mouse_report.y < 0)
+ if (code == QK_MOUSE_CURSOR_UP && mouse_report.y < 0)
mouse_report.y = 0;
- else if (code == KC_MS_DOWN && mouse_report.y > 0)
+ else if (code == QK_MOUSE_CURSOR_DOWN && mouse_report.y > 0)
mouse_report.y = 0;
- else if (code == KC_MS_LEFT && mouse_report.x < 0)
+ else if (code == QK_MOUSE_CURSOR_LEFT && mouse_report.x < 0)
mouse_report.x = 0;
- else if (code == KC_MS_RIGHT && mouse_report.x > 0)
+ else if (code == QK_MOUSE_CURSOR_RIGHT && mouse_report.x > 0)
mouse_report.x = 0;
# endif // inertia or not
- else if (code == KC_MS_WH_UP && mouse_report.v > 0)
+ else if (code == QK_MOUSE_WHEEL_UP && mouse_report.v > 0)
mouse_report.v = 0;
- else if (code == KC_MS_WH_DOWN && mouse_report.v < 0)
+ else if (code == QK_MOUSE_WHEEL_DOWN && mouse_report.v < 0)
mouse_report.v = 0;
- else if (code == KC_MS_WH_LEFT && mouse_report.h < 0)
+ else if (code == QK_MOUSE_WHEEL_LEFT && mouse_report.h < 0)
mouse_report.h = 0;
- else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0)
+ else if (code == QK_MOUSE_WHEEL_RIGHT && mouse_report.h > 0)
mouse_report.h = 0;
else if (IS_MOUSEKEY_BUTTON(code))
- mouse_report.buttons &= ~(1 << (code - KC_MS_BTN1));
- else if (code == KC_MS_ACCEL0)
+ mouse_report.buttons &= ~(1 << (code - QK_MOUSE_BUTTON_1));
+ else if (code == QK_MOUSE_ACCELERATION_0)
mousekey_accel &= ~(1 << 0);
- else if (code == KC_MS_ACCEL1)
+ else if (code == QK_MOUSE_ACCELERATION_1)
mousekey_accel &= ~(1 << 1);
- else if (code == KC_MS_ACCEL2)
+ else if (code == QK_MOUSE_ACCELERATION_2)
mousekey_accel &= ~(1 << 2);
if (mouse_report.x == 0 && mouse_report.y == 0) {
mousekey_repeat = 0;
@@ -568,29 +568,29 @@ void mousekey_on(uint8_t code) {
uint16_t const c_offset = c_offsets[mk_speed];
uint16_t const w_offset = w_offsets[mk_speed];
uint8_t const old_speed = mk_speed;
- if (code == KC_MS_UP)
+ if (code == QK_MOUSE_CURSOR_UP)
mouse_report.y = c_offset * -1;
- else if (code == KC_MS_DOWN)
+ else if (code == QK_MOUSE_CURSOR_DOWN)
mouse_report.y = c_offset;
- else if (code == KC_MS_LEFT)
+ else if (code == QK_MOUSE_CURSOR_LEFT)
mouse_report.x = c_offset * -1;
- else if (code == KC_MS_RIGHT)
+ else if (code == QK_MOUSE_CURSOR_RIGHT)
mouse_report.x = c_offset;
- else if (code == KC_MS_WH_UP)
+ else if (code == QK_MOUSE_WHEEL_UP)
mouse_report.v = w_offset;
- else if (code == KC_MS_WH_DOWN)
+ else if (code == QK_MOUSE_WHEEL_DOWN)
mouse_report.v = w_offset * -1;
- else if (code == KC_MS_WH_LEFT)
+ else if (code == QK_MOUSE_WHEEL_LEFT)
mouse_report.h = w_offset * -1;
- else if (code == KC_MS_WH_RIGHT)
+ else if (code == QK_MOUSE_WHEEL_RIGHT)
mouse_report.h = w_offset;
else if (IS_MOUSEKEY_BUTTON(code))
- mouse_report.buttons |= 1 << (code - KC_MS_BTN1);
- else if (code == KC_MS_ACCEL0)
+ mouse_report.buttons |= 1 << (code - QK_MOUSE_BUTTON_1);
+ else if (code == QK_MOUSE_ACCELERATION_0)
mk_speed = mkspd_0;
- else if (code == KC_MS_ACCEL1)
+ else if (code == QK_MOUSE_ACCELERATION_1)
mk_speed = mkspd_1;
- else if (code == KC_MS_ACCEL2)
+ else if (code == QK_MOUSE_ACCELERATION_2)
mk_speed = mkspd_2;
if (mk_speed != old_speed) adjust_speed();
}
@@ -599,30 +599,30 @@ void mousekey_off(uint8_t code) {
# ifdef MK_MOMENTARY_ACCEL
uint8_t const old_speed = mk_speed;
# endif
- if (code == KC_MS_UP && mouse_report.y < 0)
+ if (code == QK_MOUSE_CURSOR_UP && mouse_report.y < 0)
mouse_report.y = 0;
- else if (code == KC_MS_DOWN && mouse_report.y > 0)
+ else if (code == QK_MOUSE_CURSOR_DOWN && mouse_report.y > 0)
mouse_report.y = 0;
- else if (code == KC_MS_LEFT && mouse_report.x < 0)
+ else if (code == QK_MOUSE_CURSOR_LEFT && mouse_report.x < 0)
mouse_report.x = 0;
- else if (code == KC_MS_RIGHT && mouse_report.x > 0)
+ else if (code == QK_MOUSE_CURSOR_RIGHT && mouse_report.x > 0)
mouse_report.x = 0;
- else if (code == KC_MS_WH_UP && mouse_report.v > 0)
+ else if (code == QK_MOUSE_WHEEL_UP && mouse_report.v > 0)
mouse_report.v = 0;
- else if (code == KC_MS_WH_DOWN && mouse_report.v < 0)
+ else if (code == QK_MOUSE_WHEEL_DOWN && mouse_report.v < 0)
mouse_report.v = 0;
- else if (code == KC_MS_WH_LEFT && mouse_report.h < 0)
+ else if (code == QK_MOUSE_WHEEL_LEFT && mouse_report.h < 0)
mouse_report.h = 0;
- else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0)
+ else if (code == QK_MOUSE_WHEEL_RIGHT && mouse_report.h > 0)
mouse_report.h = 0;
else if (IS_MOUSEKEY_BUTTON(code))
- mouse_report.buttons &= ~(1 << (code - KC_MS_BTN1));
+ mouse_report.buttons &= ~(1 << (code - QK_MOUSE_BUTTON_1));
# ifdef MK_MOMENTARY_ACCEL
- else if (code == KC_MS_ACCEL0)
+ else if (code == QK_MOUSE_ACCELERATION_0)
mk_speed = mkspd_DEFAULT;
- else if (code == KC_MS_ACCEL1)
+ else if (code == QK_MOUSE_ACCELERATION_1)
mk_speed = mkspd_DEFAULT;
- else if (code == KC_MS_ACCEL2)
+ else if (code == QK_MOUSE_ACCELERATION_2)
mk_speed = mkspd_DEFAULT;
if (mk_speed != old_speed) adjust_speed();
# endif
diff --git a/quantum/painter/qp.h b/quantum/painter/qp.h
index 02acbf589a..820c418f43 100644
--- a/quantum/painter/qp.h
+++ b/quantum/painter/qp.h
@@ -539,6 +539,12 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai
# define GC9A01_NUM_DEVICES 0
#endif // QUANTUM_PAINTER_GC9A01_ENABLE
+#ifdef QUANTUM_PAINTER_GC9107_ENABLE
+# include "qp_gc9107.h"
+#else // QUANTUM_PAINTER_GC9107_ENABLE
+# define GC9107_NUM_DEVICES 0
+#endif // QUANTUM_PAINTER_GC9107_ENABLE
+
#ifdef QUANTUM_PAINTER_SSD1351_ENABLE
# include "qp_ssd1351.h"
#else // QUANTUM_PAINTER_SSD1351_ENABLE
diff --git a/quantum/painter/qp_internal.c b/quantum/painter/qp_internal.c
index 1f0f981796..7d4a6430af 100644
--- a/quantum/painter/qp_internal.c
+++ b/quantum/painter/qp_internal.c
@@ -16,6 +16,7 @@ enum {
+ (ST7789_NUM_DEVICES) // ST7789
+ (ST7735_NUM_DEVICES) // ST7735
+ (GC9A01_NUM_DEVICES) // GC9A01
+ + (GC9107_NUM_DEVICES) // GC9107
+ (SSD1351_NUM_DEVICES) // SSD1351
+ (SH1106_NUM_DEVICES) // SH1106
};
diff --git a/quantum/painter/rules.mk b/quantum/painter/rules.mk
index d991a6d742..7b2ab702ee 100644
--- a/quantum/painter/rules.mk
+++ b/quantum/painter/rules.mk
@@ -14,6 +14,7 @@ VALID_QUANTUM_PAINTER_DRIVERS := \
st7735_spi \
st7789_spi \
gc9a01_spi \
+ gc9107_spi \
ssd1351_spi \
sh1106_i2c \
sh1106_spi
@@ -131,10 +132,21 @@ define handle_quantum_painter_driver
OPT_DEFS += -DQUANTUM_PAINTER_GC9A01_ENABLE -DQUANTUM_PAINTER_GC9A01_SPI_ENABLE
COMMON_VPATH += \
$(DRIVER_PATH)/painter/tft_panel \
- $(DRIVER_PATH)/painter/gc9a01
+ $(DRIVER_PATH)/painter/gc9xxx
SRC += \
$(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
- $(DRIVER_PATH)/painter/gc9a01/qp_gc9a01.c
+ $(DRIVER_PATH)/painter/gc9xxx/qp_gc9a01.c
+
+ else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),gc9107_spi)
+ QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
+ QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
+ OPT_DEFS += -DQUANTUM_PAINTER_GC9107_ENABLE -DQUANTUM_PAINTER_GC9107_SPI_ENABLE
+ COMMON_VPATH += \
+ $(DRIVER_PATH)/painter/tft_panel \
+ $(DRIVER_PATH)/painter/gc9xxx
+ SRC += \
+ $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \
+ $(DRIVER_PATH)/painter/gc9xxx/qp_gc9107.c
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ssd1351_spi)
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c
index 4682aceb14..74ce9108a9 100644
--- a/quantum/pointing_device/pointing_device.c
+++ b/quantum/pointing_device/pointing_device.c
@@ -498,7 +498,7 @@ __attribute__((weak)) report_mouse_t pointing_device_task_combined_user(report_m
__attribute__((weak)) void pointing_device_keycode_handler(uint16_t keycode, bool pressed) {
if IS_MOUSEKEY_BUTTON (keycode) {
- local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - KC_MS_BTN1);
+ local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - QK_MOUSE_BUTTON_1);
pointing_device_send();
}
}
diff --git a/quantum/pointing_device/pointing_device_auto_mouse.h b/quantum/pointing_device/pointing_device_auto_mouse.h
index a596c065a3..2c0d4d1043 100644
--- a/quantum/pointing_device/pointing_device_auto_mouse.h
+++ b/quantum/pointing_device/pointing_device_auto_mouse.h
@@ -37,7 +37,7 @@
# define AUTO_MOUSE_TIME 650
#endif
#ifndef AUTO_MOUSE_DELAY
-# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(KC_MS_BTN1, &(keyrecord_t){})
+# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(QK_MOUSE_BUTTON_1, &(keyrecord_t){})
#endif
#ifndef AUTO_MOUSE_DEBOUNCE
# define AUTO_MOUSE_DEBOUNCE 25
diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c
index 264e2562b8..ce30477ee8 100644
--- a/quantum/process_keycode/process_key_override.c
+++ b/quantum/process_keycode/process_key_override.c
@@ -23,6 +23,7 @@
#include "action_util.h"
#include "quantum.h"
#include "quantum_keycodes.h"
+#include "keymap_introspection.h"
#ifndef KEY_OVERRIDE_REPEAT_DELAY
# define KEY_OVERRIDE_REPEAT_DELAY 500
@@ -83,9 +84,6 @@ static uint16_t deferred_register = 0;
// TODO: in future maybe save in EEPROM?
static bool enabled = true;
-// Public variables
-__attribute__((weak)) const key_override_t **key_overrides = NULL;
-
// Forward decls
static const key_override_t *clear_active_override(const bool allow_reregister);
@@ -247,12 +245,12 @@ static bool check_activation_event(const key_override_t *override, const bool ke
/** Iterates through the list of key overrides and tries activating each, until it finds one that activates or reaches the end of overrides. Returns true if the key action for `keycode` should be sent */
static bool try_activating_override(const uint16_t keycode, const uint8_t layer, const bool key_down, const bool is_mod, const uint8_t active_mods, bool *activated) {
- if (key_overrides == NULL) {
+ if (key_override_count() == 0) {
return true;
}
- for (uint8_t i = 0;; i++) {
- const key_override_t *const override = key_overrides[i];
+ for (uint8_t i = 0; i < key_override_count(); i++) {
+ const key_override_t *const override = key_override_get(i);
// End of array
if (override == NULL) {
diff --git a/quantum/process_keycode/process_key_override.h b/quantum/process_keycode/process_key_override.h
index 3e37c7e63a..9ec84dbe6e 100644
--- a/quantum/process_keycode/process_key_override.h
+++ b/quantum/process_keycode/process_key_override.h
@@ -55,7 +55,7 @@ typedef enum {
} ko_option_t;
/** Defines a single key override */
-typedef struct {
+typedef struct key_override_t {
// The non-modifier keycode that triggers the override. This keycode, and the necessary modifiers (trigger_mods) must be pressed to activate this override. Set this to the keycode of the key that should activate the override. Set to KC_NO to require only the necessary modifiers to be pressed and no non-modifier.
uint16_t trigger;
@@ -87,9 +87,6 @@ typedef struct {
bool *enabled;
} key_override_t;
-/** Define this as a null-terminated array of pointers to key overrides. These key overrides will be used by qmk. */
-extern const key_override_t **key_overrides;
-
/** Turns key overrides on */
void key_override_on(void);
diff --git a/quantum/process_keycode/process_rgb_matrix.c b/quantum/process_keycode/process_rgb_matrix.c
new file mode 100644
index 0000000000..fd2aa1a0c7
--- /dev/null
+++ b/quantum/process_keycode/process_rgb_matrix.c
@@ -0,0 +1,101 @@
+// Copyright 2024 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "process_rgb_matrix.h"
+#include "rgb_matrix.h"
+#include "action_util.h"
+#include "keycodes.h"
+#include "modifiers.h"
+
+bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
+#ifdef RGB_TRIGGER_ON_KEYDOWN
+ if (record->event.pressed) {
+#else
+ if (!record->event.pressed) {
+#endif
+ bool shifted = get_mods() & MOD_MASK_SHIFT;
+ switch (keycode) {
+ case QK_RGB_MATRIX_ON:
+ rgb_matrix_enable();
+ return false;
+ case QK_RGB_MATRIX_OFF:
+ rgb_matrix_disable();
+ return false;
+ case QK_RGB_MATRIX_TOGGLE:
+ rgb_matrix_toggle();
+ return false;
+ case QK_RGB_MATRIX_MODE_NEXT:
+ if (shifted) {
+ rgb_matrix_step_reverse();
+ } else {
+ rgb_matrix_step();
+ }
+ return false;
+ case QK_RGB_MATRIX_MODE_PREVIOUS:
+ if (shifted) {
+ rgb_matrix_step();
+ } else {
+ rgb_matrix_step_reverse();
+ }
+ return false;
+ case QK_RGB_MATRIX_HUE_UP:
+ if (shifted) {
+ rgb_matrix_decrease_hue();
+ } else {
+ rgb_matrix_increase_hue();
+ }
+ return false;
+ case QK_RGB_MATRIX_HUE_DOWN:
+ if (shifted) {
+ rgb_matrix_increase_hue();
+ } else {
+ rgb_matrix_decrease_hue();
+ }
+ return false;
+ case QK_RGB_MATRIX_SATURATION_UP:
+ if (shifted) {
+ rgb_matrix_decrease_sat();
+ } else {
+ rgb_matrix_increase_sat();
+ }
+ return false;
+ case QK_RGB_MATRIX_SATURATION_DOWN:
+ if (shifted) {
+ rgb_matrix_increase_sat();
+ } else {
+ rgb_matrix_decrease_sat();
+ }
+ return false;
+ case QK_RGB_MATRIX_VALUE_UP:
+ if (shifted) {
+ rgb_matrix_decrease_val();
+ } else {
+ rgb_matrix_increase_val();
+ }
+ return false;
+ case QK_RGB_MATRIX_VALUE_DOWN:
+ if (shifted) {
+ rgb_matrix_increase_val();
+ } else {
+ rgb_matrix_decrease_val();
+ }
+ return false;
+ case QK_RGB_MATRIX_SPEED_UP:
+ if (shifted) {
+ rgb_matrix_decrease_speed();
+ } else {
+ rgb_matrix_increase_speed();
+ }
+ return false;
+ case QK_RGB_MATRIX_SPEED_DOWN:
+ if (shifted) {
+ rgb_matrix_increase_speed();
+ } else {
+ rgb_matrix_decrease_speed();
+ }
+ return false;
+ }
+ }
+
+ return true;
+}
diff --git a/quantum/process_keycode/process_rgb_matrix.h b/quantum/process_keycode/process_rgb_matrix.h
new file mode 100644
index 0000000000..a02bf57b5f
--- /dev/null
+++ b/quantum/process_keycode/process_rgb_matrix.h
@@ -0,0 +1,10 @@
+// Copyright 2024 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+#include "action.h"
+
+bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record);
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index ce3b8fc81f..11df62763d 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -21,6 +21,7 @@
#include "action_util.h"
#include "timer.h"
#include "wait.h"
+#include "keymap_introspection.h"
static uint16_t active_td;
static uint16_t last_tap_time;
@@ -133,7 +134,7 @@ bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) {
if (!active_td || keycode == active_td) return false;
- action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(active_td)];
+ action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(active_td));
action->state.interrupted = true;
action->state.interrupting_keycode = keycode;
process_tap_dance_action_on_dance_finished(action);
@@ -150,11 +151,16 @@ bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) {
}
bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
+ int td_index;
tap_dance_action_t *action;
switch (keycode) {
case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
- action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(keycode)];
+ td_index = QK_TAP_DANCE_GET_INDEX(keycode);
+ if (td_index >= tap_dance_count()) {
+ return false;
+ }
+ action = tap_dance_get(td_index);
action->state.pressed = record->event.pressed;
if (record->event.pressed) {
@@ -182,7 +188,7 @@ void tap_dance_task(void) {
if (!active_td || timer_elapsed(last_tap_time) <= GET_TAPPING_TERM(active_td, &(keyrecord_t){})) return;
- action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(active_td)];
+ action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(active_td));
if (!action->state.interrupted) {
process_tap_dance_action_on_dance_finished(action);
}
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index c0137c14a3..5cccbdf439 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -35,7 +35,7 @@ typedef struct {
typedef void (*tap_dance_user_fn_t)(tap_dance_state_t *state, void *user_data);
-typedef struct {
+typedef struct tap_dance_action_t {
tap_dance_state_t state;
struct {
tap_dance_user_fn_t on_each_tap;
@@ -78,8 +78,6 @@ typedef struct {
#define TD_INDEX(code) QK_TAP_DANCE_GET_INDEX(code)
#define TAP_DANCE_KEYCODE(state) TD(((tap_dance_action_t *)state) - tap_dance_actions)
-extern tap_dance_action_t tap_dance_actions[];
-
void reset_tap_dance(tap_dance_state_t *state);
/* To be used internally */
diff --git a/quantum/process_keycode/process_underglow.c b/quantum/process_keycode/process_underglow.c
new file mode 100644
index 0000000000..779672ac07
--- /dev/null
+++ b/quantum/process_keycode/process_underglow.c
@@ -0,0 +1,91 @@
+// Copyright 2024 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "process_underglow.h"
+#include "rgblight.h"
+#include "action_util.h"
+#include "keycodes.h"
+#include "modifiers.h"
+
+bool process_underglow(uint16_t keycode, keyrecord_t *record) {
+ if (record->event.pressed) {
+ uint8_t shifted = get_mods() & MOD_MASK_SHIFT;
+ switch (keycode) {
+ case QK_UNDERGLOW_TOGGLE:
+ rgblight_toggle();
+ return false;
+ case QK_UNDERGLOW_MODE_NEXT:
+ if (shifted) {
+ rgblight_step_reverse();
+ } else {
+ rgblight_step();
+ }
+ return false;
+ case QK_UNDERGLOW_MODE_PREVIOUS:
+ if (shifted) {
+ rgblight_step();
+ } else {
+ rgblight_step_reverse();
+ }
+ return false;
+ case QK_UNDERGLOW_HUE_UP:
+ if (shifted) {
+ rgblight_decrease_hue();
+ } else {
+ rgblight_increase_hue();
+ }
+ return false;
+ case QK_UNDERGLOW_HUE_DOWN:
+ if (shifted) {
+ rgblight_increase_hue();
+ } else {
+ rgblight_decrease_hue();
+ }
+ return false;
+ case QK_UNDERGLOW_SATURATION_UP:
+ if (shifted) {
+ rgblight_decrease_sat();
+ } else {
+ rgblight_increase_sat();
+ }
+ return false;
+ case QK_UNDERGLOW_SATURATION_DOWN:
+ if (shifted) {
+ rgblight_increase_sat();
+ } else {
+ rgblight_decrease_sat();
+ }
+ return false;
+ case QK_UNDERGLOW_VALUE_UP:
+ if (shifted) {
+ rgblight_decrease_val();
+ } else {
+ rgblight_increase_val();
+ }
+ return false;
+ case QK_UNDERGLOW_VALUE_DOWN:
+ if (shifted) {
+ rgblight_increase_hue();
+ } else {
+ rgblight_decrease_hue();
+ }
+ return false;
+ case QK_UNDERGLOW_SPEED_UP:
+ if (shifted) {
+ rgblight_decrease_speed();
+ } else {
+ rgblight_increase_speed();
+ }
+ return false;
+ case QK_UNDERGLOW_SPEED_DOWN:
+ if (shifted) {
+ rgblight_increase_speed();
+ } else {
+ rgblight_decrease_speed();
+ }
+ return false;
+ }
+ }
+
+ return true;
+}
diff --git a/quantum/process_keycode/process_underglow.h b/quantum/process_keycode/process_underglow.h
new file mode 100644
index 0000000000..b409cafbb8
--- /dev/null
+++ b/quantum/process_keycode/process_underglow.h
@@ -0,0 +1,10 @@
+// Copyright 2024 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+#include "action.h"
+
+bool process_underglow(uint16_t keycode, keyrecord_t *record);
diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h
index 6ea5e13f3a..e1562077e5 100644
--- a/quantum/quantum_keycodes_legacy.h
+++ b/quantum/quantum_keycodes_legacy.h
@@ -16,3 +16,42 @@
#define RGB_VAD QK_UNDERGLOW_VALUE_DOWN
#define RGB_SPI QK_UNDERGLOW_SPEED_UP
#define RGB_SPD QK_UNDERGLOW_SPEED_DOWN
+
+#define KC_MS_UP QK_MOUSE_CURSOR_UP
+#define KC_MS_U QK_MOUSE_CURSOR_UP
+#define KC_MS_DOWN QK_MOUSE_CURSOR_DOWN
+#define KC_MS_D QK_MOUSE_CURSOR_DOWN
+#define KC_MS_LEFT QK_MOUSE_CURSOR_LEFT
+#define KC_MS_L QK_MOUSE_CURSOR_LEFT
+#define KC_MS_RIGHT QK_MOUSE_CURSOR_RIGHT
+#define KC_MS_R QK_MOUSE_CURSOR_RIGHT
+#define KC_MS_BTN1 QK_MOUSE_BUTTON_1
+#define KC_BTN1 QK_MOUSE_BUTTON_1
+#define KC_MS_BTN2 QK_MOUSE_BUTTON_2
+#define KC_BTN2 QK_MOUSE_BUTTON_2
+#define KC_MS_BTN3 QK_MOUSE_BUTTON_3
+#define KC_BTN3 QK_MOUSE_BUTTON_3
+#define KC_MS_BTN4 QK_MOUSE_BUTTON_4
+#define KC_BTN4 QK_MOUSE_BUTTON_4
+#define KC_MS_BTN5 QK_MOUSE_BUTTON_5
+#define KC_BTN5 QK_MOUSE_BUTTON_5
+#define KC_MS_BTN6 QK_MOUSE_BUTTON_6
+#define KC_BTN6 QK_MOUSE_BUTTON_6
+#define KC_MS_BTN7 QK_MOUSE_BUTTON_7
+#define KC_BTN7 QK_MOUSE_BUTTON_7
+#define KC_MS_BTN8 QK_MOUSE_BUTTON_8
+#define KC_BTN8 QK_MOUSE_BUTTON_8
+#define KC_MS_WH_UP QK_MOUSE_WHEEL_UP
+#define KC_WH_U QK_MOUSE_WHEEL_UP
+#define KC_MS_WH_DOWN QK_MOUSE_WHEEL_DOWN
+#define KC_WH_D QK_MOUSE_WHEEL_DOWN
+#define KC_MS_WH_LEFT QK_MOUSE_WHEEL_LEFT
+#define KC_WH_L QK_MOUSE_WHEEL_LEFT
+#define KC_MS_WH_RIGHT QK_MOUSE_WHEEL_RIGHT
+#define KC_WH_R QK_MOUSE_WHEEL_RIGHT
+#define KC_MS_ACCEL0 QK_MOUSE_ACCELERATION_0
+#define KC_ACL0 QK_MOUSE_ACCELERATION_0
+#define KC_MS_ACCEL1 QK_MOUSE_ACCELERATION_1
+#define KC_ACL1 QK_MOUSE_ACCELERATION_1
+#define KC_MS_ACCEL2 QK_MOUSE_ACCELERATION_2
+#define KC_ACL2 QK_MOUSE_ACCELERATION_2
diff --git a/quantum/repeat_key.c b/quantum/repeat_key.c
index 4567428723..56f242f8b8 100644
--- a/quantum/repeat_key.c
+++ b/quantum/repeat_key.c
@@ -220,10 +220,10 @@ uint16_t get_alt_repeat_key_keycode(void) {
{KC_BRIU, KC_BRID}, // Brightness Up / Down.
#endif // EXTRAKEY_ENABLE
#ifdef MOUSEKEY_ENABLE
- {KC_MS_L, KC_MS_R}, // Mouse Cursor Left / Right.
- {KC_MS_U, KC_MS_D}, // Mouse Cursor Up / Down.
- {KC_WH_L, KC_WH_R}, // Mouse Wheel Left / Right.
- {KC_WH_U, KC_WH_D}, // Mouse Wheel Up / Down.
+ {MS_LEFT, MS_RGHT}, // Mouse Cursor Left / Right.
+ {MS_UP, MS_DOWN}, // Mouse Cursor Up / Down.
+ {MS_WHLL, MS_WHLR}, // Mouse Wheel Left / Right.
+ {MS_WHLU, MS_WHLD}, // Mouse Wheel Up / Down.
#endif // MOUSEKEY_ENABLE
};
// clang-format on
diff --git a/quantum/rgblight/rgblight_drivers.c b/quantum/rgblight/rgblight_drivers.c
index 8902b8f842..76e9031aec 100644
--- a/quantum/rgblight/rgblight_drivers.c
+++ b/quantum/rgblight/rgblight_drivers.c
@@ -14,6 +14,14 @@ const rgblight_driver_t rgblight_driver = {
#elif defined(RGBLIGHT_APA102)
# include "apa102.h"
+// Temporary shim
+static void apa102_setleds(rgb_led_t *ledarray, uint16_t number_of_leds) {
+ for (uint16_t i = 0; i < number_of_leds; i++) {
+ apa102_set_color(i, ledarray[i].r, ledarray[i].g, ledarray[i].b);
+ }
+ apa102_flush();
+}
+
const rgblight_driver_t rgblight_driver = {
.init = apa102_init,
.setleds = apa102_setleds,