SwitchKeymap rendering

This commit is contained in:
József Farkas
2016-05-16 12:38:37 +02:00
parent 570202bd99
commit 5759d2db1e
8 changed files with 124 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
import {Serializable} from '../Serializable';
import {ModuleConfigurations} from './ModuleConfigurations';
import {KeyMaps} from './KeyMaps';
import {KeyMap} from './KeyMap';
import {Macros} from './Macros';
import {UhkBuffer} from '../UhkBuffer';
import {assertUInt8, assertUInt32} from '../assert';
@@ -85,4 +86,13 @@ export class UhkConfiguration extends Serializable<UhkConfiguration> {
toString(): string {
return `<UhkConfiguration signature="${this.signature}">`;
}
getKeymap(keymapId: number): KeyMap {
let keyMaps: KeyMap[] = this.keyMaps.elements;
for (let i = 0; i < keyMaps.length; ++i) {
if (keymapId === keyMaps[i].id) {
return keyMaps[i];
}
}
}
}

View File

@@ -392,7 +392,8 @@
"keyActionType": "none"
},
{
"keyActionType": "none"
"keyActionType": "switchKeymap",
"keymapId": 2
},
{
"keyActionType": "none"
@@ -824,6 +825,28 @@
]
}
]
},
{
"id": 2,
"isDefault": false,
"abbreviation": "DVR",
"name": "DVR",
"layers": [
{
"modules": [
{
"id": 0,
"pointerRole": "move",
"keyActions": []
},
{
"id": 1,
"pointerRole": "move",
"keyActions": []
}
]
}
]
}
],
"macros": [