aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_key_override.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_key_override.c')
-rw-r--r--quantum/process_keycode/process_key_override.c10
1 files changed, 4 insertions, 6 deletions
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) {