From 91971489cf1a19fdc8346dea688de002e579d2ce Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 5 Oct 2017 07:00:28 +0200 Subject: [PATCH] Stop using deprecated interfaces Use `LAYER_SHIFT_OFFSET` instead of `MOMENTARY_OFFSET`. Signed-off-by: Gergely Nagy --- src/Kaleidoscope/OneShot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kaleidoscope/OneShot.cpp b/src/Kaleidoscope/OneShot.cpp index 7b7a1695..15d485bc 100644 --- a/src/Kaleidoscope/OneShot.cpp +++ b/src/Kaleidoscope/OneShot.cpp @@ -38,7 +38,7 @@ bool OneShot::should_mask_on_interrupt_ = false; #define isOneShotKey(key) (key.raw >= ranges::OS_FIRST && key.raw <= ranges::OS_LAST) #define isModifier(key) (key.raw >= Key_LeftControl.raw && key.raw <= Key_RightGui.raw) -#define isLayerKey(key) (key.flags == (KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP) && key.keyCode >= MOMENTARY_OFFSET && key.keyCode <= MOMENTARY_OFFSET + 23) +#define isLayerKey(key) (key.flags == (KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP) && key.keyCode >= LAYER_SHIFT_OFFSET && key.keyCode <= LAYER_SHIFT_OFFSET + 23) #define isOneShot(idx) (bitRead (state_.all, (idx))) #define setOneShot(idx) (bitWrite (state_.all, idx, 1)) @@ -66,7 +66,7 @@ void OneShot::injectNormalKey(uint8_t idx, uint8_t key_state) { key.keyCode = Key_LeftControl.keyCode + idx; } else { key.flags = KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP; - key.keyCode = MOMENTARY_OFFSET + idx - 8; + key.keyCode = LAYER_SHIFT_OFFSET + idx - 8; } handleKeyswitchEvent(key, UNKNOWN_KEYSWITCH_LOCATION, key_state | INJECTED);