diff --git a/model/KeyAction.ts b/model/KeyAction.ts index 1f76dc56..9ccc4edc 100644 --- a/model/KeyAction.ts +++ b/model/KeyAction.ts @@ -4,7 +4,7 @@ class KeyAction { static fromJsObject(jsObject: any): KeyAction { - switch (jsObject.actionType) { + switch (jsObject.keyActionType) { case 'none': let keyActionNone = new KeyActionNone(); keyActionNone.fromJsObject(jsObject); diff --git a/model/KeystrokeAction.ts b/model/KeystrokeAction.ts index 650a478f..727552f1 100644 --- a/model/KeystrokeAction.ts +++ b/model/KeystrokeAction.ts @@ -32,6 +32,7 @@ class KeystrokeAction extends KeyAction implements Serializable { toJsObject(): any { return { + keyActionType: 'keystroke', scancode: this.scancode, modifierMask: this.modifierMask }; diff --git a/model/uhk-config.json b/model/uhk-config.json index e3c754a3..7073bea4 100644 --- a/model/uhk-config.json +++ b/model/uhk-config.json @@ -28,33 +28,33 @@ ], "keyActions": [ { - "actionType": "none" + "keyActionType": "none" }, { - "actionType": "keystroke", + "keyActionType": "keystroke", "scancode": 120, "modifierMask": 16 }, { - "actionType": "switchLayer", + "keyActionType": "switchLayer", "layer": "fn", "toggle": false }, { - "actionType": "dualRoleKeystroke", + "keyActionType": "dualRoleKeystroke", "scancode": 111, "longPressAction": "mod" }, { - "actionType": "mouse", + "keyActionType": "mouse", "mouseAction": "scrollDown" }, { - "actionType": "playMacro", + "keyActionType": "playMacro", "macroId": 0 }, { - "actionType": "switchKeymap", + "keyActionType": "switchKeymap", "keymapId": 1 } ] @@ -96,57 +96,57 @@ "isLooped": false, "macroActions": [ { - "actionType": "pressKey", + "macroActionType": "pressKey", "scancode": 111 }, { - "actionType": "holdKey", + "macroActionType": "holdKey", "scancode": 111 }, { - "actionType": "releaseKey", + "macroActionType": "releaseKey", "scancode": 111 }, { - "actionType": "pressModifiers", + "macroActionType": "pressModifiers", "modifierMask": 111 }, { - "actionType": "holdModifiers", + "macroActionType": "holdModifiers", "modifierMask": 111 }, { - "actionType": "releaseModifiers", + "macroActionType": "releaseModifiers", "modifierMask": 111 }, { - "actionType": "pressMouseButtons", + "macroActionType": "pressMouseButtons", "mouseButtonsMask": 9 }, { - "actionType": "holdMouseButtons", + "macroActionType": "holdMouseButtons", "mouseButtonsMask": 9 }, { - "actionType": "releaseMouseButtons", + "macroActionType": "releaseMouseButtons", "mouseButtonsMask": 9 }, { - "actionType": "moveMouse", + "macroActionType": "moveMouse", "x": 123, "y": 123 }, { - "actionType": "scrollMouse", + "macroActionType": "scrollMouse", "x": 123, "y": 123 }, { - "actionType": "delay", + "macroActionType": "delay", "delay": "1000" }, { - "actionType": "text", + "macroActionType": "text", "text": "this is a text" } ]