Implement "hold and double tap" layer switch mode and temporarily treat every hold mode keys this way.

This commit is contained in:
László Monda
2017-11-26 00:23:50 +01:00
parent bb7faaa799
commit 071be7e815
5 changed files with 39 additions and 18 deletions

View File

@@ -48,11 +48,11 @@ static parser_error_t parseKeyStrokeAction(key_action_t *keyAction, uint8_t keyS
static parser_error_t parseSwitchLayerAction(key_action_t *KeyAction, config_buffer_t *buffer)
{
uint8_t layer = ReadUInt8(buffer) + 1;
bool isToggle = ReadBool(buffer);
uint8_t mode = ReadBool(buffer) ? SwitchLayerMode_Toggle : SwitchLayerMode_HoldAndDoubleTapToggle;
KeyAction->type = KeyActionType_SwitchLayer;
KeyAction->switchLayer.layer = layer;
KeyAction->switchLayer.isToggle = isToggle;
KeyAction->switchLayer.mode = mode;
return ParserError_Success;
}