Add new system scan codes (#316)

Closes #304
This commit is contained in:
Attila Csanyi
2017-06-21 20:09:39 +02:00
committed by József Farkas
parent 6e23b2a91b
commit 2598109f8c
6 changed files with 66 additions and 1 deletions

View File

@@ -195,7 +195,8 @@ export class KeypressTabComponent extends Tab implements OnChanges {
}
private findScancodeOptionByScancode(scancode: number, type: KeystrokeType): Select2OptionData {
const typeToFind: string = type === KeystrokeType.shortMedia || KeystrokeType.longMedia ? 'media' : KeystrokeType[type];
const typeToFind: string =
(type === KeystrokeType.shortMedia || type === KeystrokeType.longMedia) ? 'media' : KeystrokeType[type];
return this.findScancodeOptionBy((option: Select2OptionData) => {
const additional = option.additional;
if (additional && additional.scancode === scancode && additional.type === typeToFind) {

View File

@@ -654,5 +654,34 @@
}
}
]
},
{
"text": "System Keys",
"children": [
{
"id": "139",
"text": "Power Down",
"additional": {
"type": "system",
"scancode": 129
}
},
{
"id": "140",
"text": "Sleep",
"additional": {
"type": "system",
"scancode": 130
}
},
{
"id": "141",
"text": "Wake Up",
"additional": {
"type": "system",
"scancode": 131
}
}
]
}
]