aboutsummaryrefslogtreecommitdiffstats
path: root/src/ginput/ginput_keyboard_microcode.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-01-21 17:26:24 +1000
committerinmarket <andrewh@inmarket.com.au>2015-01-21 17:26:24 +1000
commitfa8167b94d13e94a6cb953e7f549a89f155f77c6 (patch)
tree8c33f78c45ca72ac2653327607f1d7caed668c5e /src/ginput/ginput_keyboard_microcode.c
parent34939386d7390b0876973a1969f336b814313a22 (diff)
downloaduGFX-fa8167b94d13e94a6cb953e7f549a89f155f77c6.tar.gz
uGFX-fa8167b94d13e94a6cb953e7f549a89f155f77c6.tar.bz2
uGFX-fa8167b94d13e94a6cb953e7f549a89f155f77c6.zip
Big file rename to reduce problems with brain-dead IDE's that don't handle project file hierarchies well.
Naming is more consistent with the new scheme. May affect some third party drivers (header file renames).
Diffstat (limited to 'src/ginput/ginput_keyboard_microcode.c')
-rw-r--r--src/ginput/ginput_keyboard_microcode.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/ginput/ginput_keyboard_microcode.c b/src/ginput/ginput_keyboard_microcode.c
new file mode 100644
index 00000000..e3c04d5f
--- /dev/null
+++ b/src/ginput/ginput_keyboard_microcode.c
@@ -0,0 +1,73 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://ugfx.org/license.html
+ */
+
+/**
+ * @file src/ginput/keyboard_microcode.c
+ * @brief GINPUT keyboard standard microcode definitions.
+ */
+
+#include "gfx.h"
+
+#if GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD && !GKEYBOARD_LAYOUT_OFF
+
+#include "keyboard_microcode.h"
+
+#if GKEYBOARD_LAYOUT_SCANCODE2_US
+
+ #error "Keyboard Layout SCANCODE2_US is not fully implemented yet"
+
+ uint8_t KeyboardLayout_ScancodeSet2_US[] = {
+ KMC_HEADERSTART, KMC_HEADER_ID1, KMC_HEADER_ID2, KMC_HEADER_VER_1,
+
+ KMC_RECORDSTART, 0x03, // Handle E0 codes (ignore for now assuming a single character)
+ KMC_TEST_LASTCODE, 0xE0,
+ KMC_ACT_DONE,
+ KMC_RECORDSTART, 0x03,
+ KMC_TEST_CODE, 0xE0,
+ KMC_ACT_STOP,
+
+ KMC_RECORDSTART, 0x03, // Handle E1 codes (ignore for now assuming a single character)
+ KMC_TEST_LASTCODE, 0xE1,
+ KMC_ACT_DONE,
+ KMC_RECORDSTART, 0x03,
+ KMC_TEST_CODE, 0xE1,
+ KMC_ACT_STOP,
+
+ KMC_RECORDSTART, 0x03, // Handle E2 codes (ignore for now assuming a single character)
+ KMC_TEST_LASTCODE, 0xE2,
+ KMC_ACT_DONE,
+ KMC_RECORDSTART, 0x03,
+ KMC_TEST_CODE, 0xE2,
+ KMC_ACT_STOP,
+
+ KMC_RECORDSTART, 0x06, // KeyUp
+ KMC_TEST_CODEBIT, 0x80,
+ KMC_ACT_STATEBIT, GKEYSTATE_KEYUP_BIT,
+ KMC_ACT_CODEBIT, 0x80 | KMC_BIT_CLEAR,
+
+ KMC_RECORDSTART, 0x05, // CapsLock (on keyup to avoid repeats)
+ KMC_TEST_CODE, 0x58,
+ KMC_TEST_STATEBIT, GKEYSTATE_KEYUP_BIT | KMC_BIT_CLEAR,
+ KMC_ACT_DONE,
+ KMC_RECORDSTART, 0x05,
+ KMC_TEST_CODE, 0x58,
+ KMC_ACT_STATEBIT, GKEYSTATE_CAPSLOCK_BIT | KMC_BIT_INVERT,
+ KMC_ACT_DONE,
+
+ KMC_RECORDSTART, 0x05, // Detect Shift Keys
+ //KMC_ACT_LAYOUTBIT, SCANCODESET2_LAYOUT_E0_BIT | KMC_BIT_CLEAR,
+ KMC_ACT_STOP,
+
+ KMC_RECORDSTART, 0x03,
+ KMC_ACT_CHARRANGE, 0x00,
+ KMC_ACT_DONE,
+
+ KMC_RECORDSTART, 0x00,
+ };
+#endif // GKEYBOARD_LAYOUT_SCANCODE2_US
+
+#endif // GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD && !GKEYBOARD_LAYOUT_OFF