Maintain the states of previous key states.

This commit is contained in:
László Monda
2017-11-03 13:43:16 +01:00
parent b18cb651ce
commit 05bbd28877

View File

@@ -139,11 +139,8 @@ void UpdateActiveUsbReports(void)
for (uint8_t slotId=0; slotId<SLOT_COUNT; slotId++) { for (uint8_t slotId=0; slotId<SLOT_COUNT; slotId++) {
for (uint8_t keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) { for (uint8_t keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) {
key_state_t keyState = KeyStates[slotId][keyId];
if (!KeyStates[slotId][keyId].current) { if (keyState.current) {
continue;
}
key_action_t action = CurrentKeymap[activeLayer][slotId][keyId]; key_action_t action = CurrentKeymap[activeLayer][slotId][keyId];
switch (action.type) { switch (action.type) {
case KeyActionType_Keystroke: case KeyActionType_Keystroke:
@@ -178,6 +175,8 @@ void UpdateActiveUsbReports(void)
break; break;
} }
} }
keyState.previous = keyState.current;
}
} }
// When a layer switcher key gets pressed along with another key that produces some modifiers // When a layer switcher key gets pressed along with another key that produces some modifiers