summaryrefslogtreecommitdiff
path: root/hid
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-07-29 15:10:48 +0300
committerMaxim Devaev <[email protected]>2022-07-29 15:10:48 +0300
commit52ea19b44ac8525b2b46451250c58c1145eab5aa (patch)
treed1c4aeb74f42965b4d52a004988970c3e40dd813 /hid
parentfbd1ff520875042bf0601cb6b0720b36b48fef1b (diff)
common usb-keymap.h
Diffstat (limited to 'hid')
-rw-r--r--hid/lib/drivers-avr/usb/hid.h2
-rw-r--r--hid/lib/drivers-stm32/usb/keyboard-stm32.h2
-rw-r--r--hid/lib/drivers-stm32/usb/keymap.h137
-rw-r--r--hid/lib/drivers-stm32/usb/keymap.h.mako37
-rw-r--r--hid/lib/drivers/usb-keymap.h (renamed from hid/lib/drivers-avr/usb/keymap.h)0
-rw-r--r--hid/lib/drivers/usb-keymap.h.mako (renamed from hid/lib/drivers-avr/usb/keymap.h.mako)0
6 files changed, 2 insertions, 176 deletions
diff --git a/hid/lib/drivers-avr/usb/hid.h b/hid/lib/drivers-avr/usb/hid.h
index 6b334af8..2712734b 100644
--- a/hid/lib/drivers-avr/usb/hid.h
+++ b/hid/lib/drivers-avr/usb/hid.h
@@ -28,10 +28,10 @@
#include "keyboard.h"
#include "mouse.h"
#include "tools.h"
+#include "usb-keymap.h"
#ifdef AUM
# include "aum.h"
#endif
-#include "keymap.h"
using namespace DRIVERS;
diff --git a/hid/lib/drivers-stm32/usb/keyboard-stm32.h b/hid/lib/drivers-stm32/usb/keyboard-stm32.h
index be8c7bd1..427b1ec8 100644
--- a/hid/lib/drivers-stm32/usb/keyboard-stm32.h
+++ b/hid/lib/drivers-stm32/usb/keyboard-stm32.h
@@ -26,8 +26,8 @@
#include "tools.h"
#include "keyboard.h"
+#include "usb-keymap.h"
#include "hid-wrapper-stm32.h"
-#include "keymap.h"
namespace DRIVERS {
diff --git a/hid/lib/drivers-stm32/usb/keymap.h b/hid/lib/drivers-stm32/usb/keymap.h
deleted file mode 100644
index a63598cf..00000000
--- a/hid/lib/drivers-stm32/usb/keymap.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*****************************************************************************
-# #
-# KVMD - The main PiKVM daemon. #
-# #
-# Copyright (C) 2018-2022 Maxim Devaev <[email protected]> #
-# #
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation, either version 3 of the License, or #
-# (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with this program. If not, see <https://www.gnu.org/licenses/>. #
-# #
-*****************************************************************************/
-
-
-#pragma once
-
-
-uint8_t keymapUsb(uint8_t code) {
- switch (code) {
- case 1: return 4; // KeyA
- case 2: return 5; // KeyB
- case 3: return 6; // KeyC
- case 4: return 7; // KeyD
- case 5: return 8; // KeyE
- case 6: return 9; // KeyF
- case 7: return 10; // KeyG
- case 8: return 11; // KeyH
- case 9: return 12; // KeyI
- case 10: return 13; // KeyJ
- case 11: return 14; // KeyK
- case 12: return 15; // KeyL
- case 13: return 16; // KeyM
- case 14: return 17; // KeyN
- case 15: return 18; // KeyO
- case 16: return 19; // KeyP
- case 17: return 20; // KeyQ
- case 18: return 21; // KeyR
- case 19: return 22; // KeyS
- case 20: return 23; // KeyT
- case 21: return 24; // KeyU
- case 22: return 25; // KeyV
- case 23: return 26; // KeyW
- case 24: return 27; // KeyX
- case 25: return 28; // KeyY
- case 26: return 29; // KeyZ
- case 27: return 30; // Digit1
- case 28: return 31; // Digit2
- case 29: return 32; // Digit3
- case 30: return 33; // Digit4
- case 31: return 34; // Digit5
- case 32: return 35; // Digit6
- case 33: return 36; // Digit7
- case 34: return 37; // Digit8
- case 35: return 38; // Digit9
- case 36: return 39; // Digit0
- case 37: return 40; // Enter
- case 38: return 41; // Escape
- case 39: return 42; // Backspace
- case 40: return 43; // Tab
- case 41: return 44; // Space
- case 42: return 45; // Minus
- case 43: return 46; // Equal
- case 44: return 47; // BracketLeft
- case 45: return 48; // BracketRight
- case 46: return 49; // Backslash
- case 47: return 51; // Semicolon
- case 48: return 52; // Quote
- case 49: return 53; // Backquote
- case 50: return 54; // Comma
- case 51: return 55; // Period
- case 52: return 56; // Slash
- case 53: return 57; // CapsLock
- case 54: return 58; // F1
- case 55: return 59; // F2
- case 56: return 60; // F3
- case 57: return 61; // F4
- case 58: return 62; // F5
- case 59: return 63; // F6
- case 60: return 64; // F7
- case 61: return 65; // F8
- case 62: return 66; // F9
- case 63: return 67; // F10
- case 64: return 68; // F11
- case 65: return 69; // F12
- case 66: return 70; // PrintScreen
- case 67: return 73; // Insert
- case 68: return 74; // Home
- case 69: return 75; // PageUp
- case 70: return 76; // Delete
- case 71: return 77; // End
- case 72: return 78; // PageDown
- case 73: return 79; // ArrowRight
- case 74: return 80; // ArrowLeft
- case 75: return 81; // ArrowDown
- case 76: return 82; // ArrowUp
- case 77: return 224; // ControlLeft
- case 78: return 225; // ShiftLeft
- case 79: return 226; // AltLeft
- case 80: return 227; // MetaLeft
- case 81: return 228; // ControlRight
- case 82: return 229; // ShiftRight
- case 83: return 230; // AltRight
- case 84: return 231; // MetaRight
- case 85: return 72; // Pause
- case 86: return 71; // ScrollLock
- case 87: return 83; // NumLock
- case 88: return 101; // ContextMenu
- case 89: return 84; // NumpadDivide
- case 90: return 85; // NumpadMultiply
- case 91: return 86; // NumpadSubtract
- case 92: return 87; // NumpadAdd
- case 93: return 88; // NumpadEnter
- case 94: return 89; // Numpad1
- case 95: return 90; // Numpad2
- case 96: return 91; // Numpad3
- case 97: return 92; // Numpad4
- case 98: return 93; // Numpad5
- case 99: return 94; // Numpad6
- case 100: return 95; // Numpad7
- case 101: return 96; // Numpad8
- case 102: return 97; // Numpad9
- case 103: return 98; // Numpad0
- case 104: return 99; // NumpadDecimal
- case 105: return 102; // Power
- case 106: return 100; // IntlBackslash
- case 107: return 137; // IntlYen
- default: return 0;
- }
-}
diff --git a/hid/lib/drivers-stm32/usb/keymap.h.mako b/hid/lib/drivers-stm32/usb/keymap.h.mako
deleted file mode 100644
index 3e2324ef..00000000
--- a/hid/lib/drivers-stm32/usb/keymap.h.mako
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************************
-# #
-# KVMD - The main PiKVM daemon. #
-# #
-# Copyright (C) 2018-2022 Maxim Devaev <[email protected]> #
-# #
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation, either version 3 of the License, or #
-# (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with this program. If not, see <https://www.gnu.org/licenses/>. #
-# #
-*****************************************************************************/
-
-
-#pragma once
-
-<%! import operator %>
-uint8_t keymapUsb(uint8_t code) {
- switch (code) {
-% for km in sorted(keymap, key=operator.attrgetter("mcu_code")):
- % if km.usb_key.is_modifier:
- case ${km.mcu_code}: return ${km.usb_key.arduino_modifier_code}; // ${km.web_name}
- % else:
- case ${km.mcu_code}: return ${km.usb_key.code}; // ${km.web_name}
- % endif
-% endfor
- default: return 0;
- }
-}
diff --git a/hid/lib/drivers-avr/usb/keymap.h b/hid/lib/drivers/usb-keymap.h
index a63598cf..a63598cf 100644
--- a/hid/lib/drivers-avr/usb/keymap.h
+++ b/hid/lib/drivers/usb-keymap.h
diff --git a/hid/lib/drivers-avr/usb/keymap.h.mako b/hid/lib/drivers/usb-keymap.h.mako
index 3e2324ef..3e2324ef 100644
--- a/hid/lib/drivers-avr/usb/keymap.h.mako
+++ b/hid/lib/drivers/usb-keymap.h.mako