summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-02-21 11:50:57 +0300
committerDevaev Maxim <[email protected]>2020-02-21 11:50:57 +0300
commitb7419ecb3a3710e4722f42d934826f6e6dc49cd7 (patch)
tree6d8eafb69999899dd64d78608586289b4588792a
parentb8b9bbe53a7f771a8ce4bc331bab30d27d06507c (diff)
supported menu and numlock keys
-rw-r--r--hid/src/keymap.h2
-rw-r--r--keymap.in7
-rw-r--r--kvmd/keymap.py8
3 files changed, 13 insertions, 4 deletions
diff --git a/hid/src/keymap.h b/hid/src/keymap.h
index ac7bc5ea..c66a454d 100644
--- a/hid/src/keymap.h
+++ b/hid/src/keymap.h
@@ -82,8 +82,10 @@ INLINE KeyboardKeycode keymap(uint8_t code) {
case 80: return KEY_LEFT_GUI;
case 78: return KEY_LEFT_SHIFT;
case 13: return KEY_M;
+ case 88: return KEY_MENU;
case 42: return KEY_MINUS;
case 14: return KEY_N;
+ case 87: return KEY_NUM_LOCK;
case 15: return KEY_O;
case 16: return KEY_P;
case 72: return KEY_PAGE_DOWN;
diff --git a/keymap.in b/keymap.in
index 337498f4..e2845194 100644
--- a/keymap.in
+++ b/keymap.in
@@ -20,7 +20,7 @@
# ========================================================================== #
-# https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
+# https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values
# https://github.com/NicoHood/HID/blob/master/src/KeyboardLayouts/ImprovedKeylayouts.h
# https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2
@@ -113,8 +113,9 @@ AltRight 83 KEY_RIGHT_ALT 0x40 m
MetaRight 84 KEY_RIGHT_GUI 0x80 m
Pause 85 KEY_PAUSE 0x48 -
ScrollLock 86 KEY_SCROLL_LOCK 0x47 -
+NumLock 87 KEY_NUM_LOCK 0x53 -
+ContextMenu 88 KEY_MENU 0x65 -
# KEY_NON_US_NUM
-# KEY_NUM_LOCK
# KEYPAD_DIVIDE
# KEYPAD_MULTIPLY
# KEYPAD_SUBTRACT
@@ -132,5 +133,3 @@ ScrollLock 86 KEY_SCROLL_LOCK 0x47 -
# KEYPAD_0
# KEYPAD_DOT
# KEY_NON_US
-# KEY_APPLICATION
-# KEY_MENU
diff --git a/kvmd/keymap.py b/kvmd/keymap.py
index 3b4a713e..a263ea01 100644
--- a/kvmd/keymap.py
+++ b/kvmd/keymap.py
@@ -389,4 +389,12 @@ KEYMAP: Dict[str, Key] = {
serial=SerialKey(code=86),
otg=OtgKey(code=71, is_modifier=False),
),
+ "NumLock": Key(
+ serial=SerialKey(code=87),
+ otg=OtgKey(code=83, is_modifier=False),
+ ),
+ "ContextMenu": Key(
+ serial=SerialKey(code=88),
+ otg=OtgKey(code=101, is_modifier=False),
+ ),
}