diff --git a/model/KeyAction.ts b/model/KeyAction.ts index 9ccc4edc..0634546e 100644 --- a/model/KeyAction.ts +++ b/model/KeyAction.ts @@ -5,11 +5,11 @@ class KeyAction { static fromJsObject(jsObject: any): KeyAction { switch (jsObject.keyActionType) { - case 'none': + case KeystrokeAction.actionTypeString: let keyActionNone = new KeyActionNone(); keyActionNone.fromJsObject(jsObject); return keyActionNone; - case 'keyStroke': + case KeystrokeAction.actionTypeString: let keystrokeAction = new KeystrokeAction(); keystrokeAction.fromJsObject(jsObject); return keystrokeAction; diff --git a/model/KeyActionNone.ts b/model/KeyActionNone.ts index b483da67..78a55625 100644 --- a/model/KeyActionNone.ts +++ b/model/KeyActionNone.ts @@ -2,6 +2,7 @@ /// class KeyActionNone extends KeyAction implements Serializable { + static actionTypeString = 'none'; static keyActionNoneId = 0; static keyActionNoneParam = 0; diff --git a/model/KeystrokeAction.ts b/model/KeystrokeAction.ts index 727552f1..b34d53e9 100644 --- a/model/KeystrokeAction.ts +++ b/model/KeystrokeAction.ts @@ -3,6 +3,7 @@ class KeystrokeAction extends KeyAction implements Serializable { + static actionTypeString = 'keyStroke'; static firstValidScancode = 1; static lastValidScancode = 231;