From 4414d9cfbad629604a157cde99ef79f65d7cb954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Thu, 15 Jun 2017 23:19:51 +0200 Subject: [PATCH] Treat keystroke actions as none actions when no scancode, modifiers and long press action is specified. --- .../config-items/key-action/KeystrokeAction.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts b/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts index df4d2cc8..d5e29bfe 100644 --- a/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts +++ b/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts @@ -149,7 +149,10 @@ export class KeystrokeAction extends KeyAction { const TYPE_OFFSET = flags + (this.type << KEYSTROKE_ACTION_FLAG_LENGTH); - buffer.writeUInt8(KeyActionId.KeystrokeAction + TYPE_OFFSET); + // A keystroke action without scancode, modifiers, and long press + // action is just like a none action, so they overlap on purpose. + buffer.writeUInt8(KeyActionId.NoneAction + TYPE_OFFSET); + for (let i = 0; i < toWrite.length; ++i) { if (toWrite[i].long) { buffer.writeUInt16(toWrite[i].data);