From 16596d8a189495db44e564e7e71ac4ab147be21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Thu, 15 Jun 2017 23:51:21 +0200 Subject: [PATCH] Fix flags restoration in KeystrokeAction fromBinary --- .../config-items/key-action/KeystrokeAction.ts | 2 +- 1 file changed, 1 insertion(+), 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 d5e29bfe..6e8255fa 100644 --- a/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts +++ b/shared/src/config-serializer/config-items/key-action/KeystrokeAction.ts @@ -85,7 +85,7 @@ export class KeystrokeAction extends KeyAction { fromBinary(buffer: UhkBuffer): KeystrokeAction { const keyActionId: KeyActionId = this.readAndAssertKeyActionId(buffer); - const flags: number = keyActionId - KeyActionId.KeystrokeAction; + const flags: number = keyActionId - KeyActionId.NoneAction; // NoneAction is the same is an empty KeystrokeAction this.type = (flags >> 3) & 0b11; if (flags & KeystrokeActionFlag.scancode) { this._scancode = this.type === KeystrokeType.longMedia ? buffer.readUInt16() : buffer.readUInt8();