]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Initial work for KLL macro support
authorJacob Alexander <haata@kiibohd.com>
Sat, 14 Jun 2014 18:00:29 +0000 (11:00 -0700)
committerJacob Alexander <haata@kiibohd.com>
Sat, 14 Jun 2014 18:00:29 +0000 (11:00 -0700)
Macro/PartialMap/macro.c
Macro/PartialMap/macro.h
Macro/PartialMap/usb_hid.h

index 80f0c5d40748d9cd65bcc10edf056698755bf529..968835e30da503e0a0ecfc75d3a2e63f0b98a509 100644 (file)
@@ -73,6 +73,44 @@ uint8_t macroDebugMode = 0;
 
 // ----- Functions -----
 
+// Looks up the start of the function ptr list for the active layer, by scan code
+inline void *Macro_layerLookup( uint8_t scanCode )
+{
+       // TODO
+       return 0;
+}
+
+
+// Called for each key from the Scan Module for one of three cases:
+//  1. Key is pressed         (PRESSED)
+//  2. Key is being held down (HELD)
+//  3. Key is released        (RELEASED)
+// If Scan Module is for an analog sense keyboard, do not use the defined keystates
+// This function should not be called if not pressed (depressed) or at 0%
+inline void Macro_keyUpdate( uint8_t scanCode, uint8_t state )
+{
+       // Do layer lookup to find which capabilities to map
+       void *capabilities = Macro_layerLookup( scanCode );
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 inline void Macro_bufferAdd( uint8_t byte )
 {
        // Make sure we haven't overflowed the key buffer
@@ -129,7 +167,7 @@ inline void Macro_process()
                return;
 
        // Loop through input buffer
-       for ( uint8_t index = 0; index < KeyIndex_BufferUsed; index++ )
+       for ( uint8_t index = 0; index < KeyIndex_BufferUsed && !macroDebugMode; index++ )
        {
                //print(" KEYS: ");
                //printInt8( KeyIndex_BufferUsed );
index 145520090dfb64a2ed905d57359b52e19cc76b17..377f9ecfdb038dd41eb29063570f5a8643b3cdde 100644 (file)
 
 
 
+// ----- Defines -----
+
+// Key states (DO NOT USE for analog keyboards)
+#define DEPRESSED 0
+#define  RELEASED 1
+#define   PRESSED 254
+#define      HELD 255
+
+
 // ----- Variables -----
 
 
index 6350a073e35b05b1185d7586e0f710cd90425c53..261e36a5323ba769b0aa804dc46773d75d9f3a68 100644 (file)
@@ -81,7 +81,8 @@
 #define KEY_NUMBER         0x32
 #define KEY_SEMICOLON      0x33
 #define KEY_QUOTE          0x34
-#define KEY_TILDE          0x35
+#define KEY_TILDE          0x35 // TODO Removeme (old definition)
+#define KEY_BACKTICK       0x35
 #define KEY_COMMA          0x36
 #define KEY_PERIOD         0x37
 #define KEY_SLASH          0x38
 #define KEYPAD_9           0x61
 #define KEYPAD_0           0x62
 #define KEYPAD_PERIOD      0x63
-#define KEY_ISO_BACKSLASH  0x64
+#define KEY_ISO_BACKSLASH  0x64 // TODO Removeme (old definition)
+#define KEY_ISO_SLASH      0x64
 #define KEY_APP            0x65
 #define KEYBOARD_STATUS    0x66 // Used for indicating status or errors, not a key
 #define KEYPAD_EQUAL       0x67
 #define KEY_MUTE           0x7F
 #define KEY_VOL_UP         0x80
 #define KEY_VOL_DOWN       0x81
-#define KEY_CAPS_LLOCK     0x82 // "Locking" Scroll Lock (Old keyboards with Locking Caps Lock)
-#define KEY_NUM_LLOCK      0x83
-#define KEY_SCROLL_LLOCK   0x84
+#define KEY_CAPS_TLOCK     0x82 // Toggle "Locking" Scroll Lock (Old keyboards with Locking Caps Lock)
+#define KEY_NUM_TLOCK      0x83
+#define KEY_SCROLL_TLOCK   0x84
 #define KEYPAD_COMMA       0x85 // Brazillian (See spec)
 #define KEYPAD_EQUAL_AS    0x86 // AS/400 Keyboard (See spec)
 #define KEY_INTER1         0x87 // KANJI1 - Brazillian and Japanese "Ru" and "-"