From f0b2bfd5ca5b416a9c7c9bef8c2850f1084bd106 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 15 Oct 2022 14:33:24 +1100 Subject: Programmable Button API refactor and improve docs (#18641) --- quantum/process_keycode/process_programmable_button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/process_keycode/process_programmable_button.c') diff --git a/quantum/process_keycode/process_programmable_button.c b/quantum/process_keycode/process_programmable_button.c index c6e77faacc..6379698848 100644 --- a/quantum/process_keycode/process_programmable_button.c +++ b/quantum/process_keycode/process_programmable_button.c @@ -22,9 +22,9 @@ bool process_programmable_button(uint16_t keycode, keyrecord_t *record) { if (keycode >= PROGRAMMABLE_BUTTON_MIN && keycode <= PROGRAMMABLE_BUTTON_MAX) { uint8_t button = keycode - PROGRAMMABLE_BUTTON_MIN + 1; if (record->event.pressed) { - programmable_button_on(button); + programmable_button_register(button); } else { - programmable_button_off(button); + programmable_button_unregister(button); } } return true; -- cgit v1.2.3 From 6bbe8b6eddc56d43f4db07c665bf1791ea2ab871 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 25 Oct 2022 01:50:33 +1100 Subject: Normalise Joystick and Programmable Button keycodes (#18832) --- quantum/process_keycode/process_programmable_button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/process_keycode/process_programmable_button.c') diff --git a/quantum/process_keycode/process_programmable_button.c b/quantum/process_keycode/process_programmable_button.c index 6379698848..d6a14e120c 100644 --- a/quantum/process_keycode/process_programmable_button.c +++ b/quantum/process_keycode/process_programmable_button.c @@ -19,8 +19,8 @@ along with this program. If not, see . #include "programmable_button.h" bool process_programmable_button(uint16_t keycode, keyrecord_t *record) { - if (keycode >= PROGRAMMABLE_BUTTON_MIN && keycode <= PROGRAMMABLE_BUTTON_MAX) { - uint8_t button = keycode - PROGRAMMABLE_BUTTON_MIN + 1; + if (keycode >= QK_PROGRAMMABLE_BUTTON_MIN && keycode <= QK_PROGRAMMABLE_BUTTON_MAX) { + uint8_t button = keycode - QK_PROGRAMMABLE_BUTTON_MIN + 1; if (record->event.pressed) { programmable_button_register(button); } else { -- cgit v1.2.3 From a69ab05dd687cb9aa38e0c125e4f64956c7da6c7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 5 Nov 2022 10:30:09 +0000 Subject: Initial DD keycode migration (#18643) * Initial DD keycode migration * Sort magic keycodes --- quantum/process_keycode/process_programmable_button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/process_keycode/process_programmable_button.c') diff --git a/quantum/process_keycode/process_programmable_button.c b/quantum/process_keycode/process_programmable_button.c index d6a14e120c..03034edb61 100644 --- a/quantum/process_keycode/process_programmable_button.c +++ b/quantum/process_keycode/process_programmable_button.c @@ -19,8 +19,8 @@ along with this program. If not, see . #include "programmable_button.h" bool process_programmable_button(uint16_t keycode, keyrecord_t *record) { - if (keycode >= QK_PROGRAMMABLE_BUTTON_MIN && keycode <= QK_PROGRAMMABLE_BUTTON_MAX) { - uint8_t button = keycode - QK_PROGRAMMABLE_BUTTON_MIN + 1; + if (IS_QK_PROGRAMMABLE_BUTTON(keycode)) { + uint8_t button = keycode - QK_PROGRAMMABLE_BUTTON + 1; if (record->event.pressed) { programmable_button_register(button); } else { -- cgit v1.2.3