From 929e18106ea58d01bfd4f971f2b8f3b9117d5fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Mon, 16 May 2016 16:52:33 +0200 Subject: [PATCH] Media key texts rendering --- config-serializer/uhk-config.json | 37 ++++++++++++++++++------------- src/services/mapper.service.ts | 16 +++++++++++++ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/config-serializer/uhk-config.json b/config-serializer/uhk-config.json index a1940f9b..a919d1da 100644 --- a/config-serializer/uhk-config.json +++ b/config-serializer/uhk-config.json @@ -577,7 +577,16 @@ "keyActionType": "none" }, { - "keyActionType": "none" + "keyActionType": "keystroke", + "scancode": 232 + }, + { + "keyActionType": "keystroke", + "scancode": 237 + }, + { + "keyActionType": "keystroke", + "scancode": 233 }, { "keyActionType": "none" @@ -595,7 +604,16 @@ "keyActionType": "none" }, { - "keyActionType": "none" + "keyActionType": "keystroke", + "scancode": 234 + }, + { + "keyActionType": "keystroke", + "scancode": 238 + }, + { + "keyActionType": "keystroke", + "scancode": 235 }, { "keyActionType": "none" @@ -613,19 +631,8 @@ "keyActionType": "none" }, { - "keyActionType": "none" - }, - { - "keyActionType": "none" - }, - { - "keyActionType": "none" - }, - { - "keyActionType": "none" - }, - { - "keyActionType": "none" + "keyActionType": "keystroke", + "scancode": 239 }, { "keyActionType": "none" diff --git a/src/services/mapper.service.ts b/src/services/mapper.service.ts index 958a0dff..4ffe2c9c 100644 --- a/src/services/mapper.service.ts +++ b/src/services/mapper.service.ts @@ -93,6 +93,7 @@ export class MapperService { private nameToFileName: Map; constructor() { + this.initScanCodeTextMap(); this.initScanCodeFileName(); this.initNameToFileNames(); } @@ -113,6 +114,21 @@ export class MapperService { return 'build/compiled_sprite.svg#' + this.nameToFileName.get(iconName); } + private initScanCodeTextMap(): void { + this.scanCodeTextMap[232] = ['Play']; + this.scanCodeTextMap[233] = ['Stop']; + this.scanCodeTextMap[234] = ['Prev']; + this.scanCodeTextMap[235] = ['Next']; + this.scanCodeTextMap[236] = ['Eject']; + this.scanCodeTextMap[237] = ['Vol +']; + this.scanCodeTextMap[238] = ['Vol -']; + this.scanCodeTextMap[239] = ['Mute']; + this.scanCodeTextMap[240] = ['WWW']; + this.scanCodeTextMap[241] = ['Bckwrd']; + this.scanCodeTextMap[242] = ['Frwrd']; + this.scanCodeTextMap[243] = ['Cancel']; + } + private initScanCodeFileName(): void { this.scanCodeFileName = new Map(); this.scanCodeFileName[79] = 'icon-kbd__mod--arrow-right';