Block out basic keycodes
This commit is contained in:
parent
218bd48ebc
commit
ea92d5ed7d
3 changed files with 1309 additions and 7 deletions
1298
data/constants/keycodes_0.0.1.json
Normal file
1298
data/constants/keycodes_0.0.1.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,10 @@
|
|||
{
|
||||
version: 0.1.0
|
||||
|
||||
uses: {
|
||||
keycodes: 0.0.1
|
||||
}
|
||||
|
||||
documentation: {
|
||||
order: [
|
||||
broadcast_messages
|
||||
|
|
|
@ -4,17 +4,17 @@ import cmd
|
|||
import json
|
||||
import random
|
||||
import gzip
|
||||
from pathlib import Path
|
||||
from platform import platform
|
||||
|
||||
from milc import cli
|
||||
|
||||
KEYCODE_MAP = {
|
||||
# TODO: this should be data driven...
|
||||
0x04: 'KC_A',
|
||||
0x05: 'KC_B',
|
||||
0x29: 'KC_ESCAPE',
|
||||
0xF9: 'KC_MS_WH_UP',
|
||||
}
|
||||
from qmk.json_schema import json_load
|
||||
|
||||
# TODO: get from xap "uses" for the current device
|
||||
keycode_version = '0.0.1'
|
||||
spec = json_load(Path(f'data/constants/keycodes_{keycode_version}.json'))
|
||||
KEYCODE_MAP = {int(k, 16): v.get('key') for k, v in spec['keycodes'].items()}
|
||||
|
||||
|
||||
def _is_xap_usage(x):
|
||||
|
|
Loading…
Reference in a new issue