Adjust to the flags/keyCode swap

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 561eb7a53d
commit bceb05148c

@ -35,8 +35,8 @@ namespace Akela {
// --- helper macros ------ // --- helper macros ------
#define isOS(key) (key.raw >= OS_FIRST && key.raw <= OS_LAST) #define isOS(key) (key.raw >= OS_FIRST && key.raw <= OS_LAST)
#define isModifier(key) (key.keyCode >= Key_LCtrl.raw && key.keyCode <= Key_RGUI.raw && key.flags == 0) #define isModifier(key) (key.raw >= Key_LCtrl.raw && key.raw <= Key_RGUI.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 >= MOMENTARY_OFFSET && key.keyCode <= MOMENTARY_OFFSET + 23)
#define isOneShot(idx) (bitRead (State, idx)) #define isOneShot(idx) (bitRead (State, idx))
#define setOneShot(idx) (bitWrite (State, idx, 1)) #define setOneShot(idx) (bitWrite (State, idx, 1))
@ -87,6 +87,14 @@ namespace Akela {
if (keyState & INJECTED) if (keyState & INJECTED)
return mappedKey; return mappedKey;
if (key_toggled_on (keyState)) {
Serial.print ("isModifier=");
Serial.print (isModifier (mappedKey));
Serial.print ("; isLayerKey=");
Serial.println (isLayerKey (mappedKey));
}
if (!isModifier (mappedKey) && !isLayerKey (mappedKey)) if (!isModifier (mappedKey) && !isLayerKey (mappedKey))
return mappedKey; return mappedKey;

Loading…
Cancel
Save