]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Scan/DPH/scan_loop.c
Initial work for partial layers and macros.
[kiibohd-controller.git] / Scan / DPH / scan_loop.c
index c4d4284e46f1ff974968a9d0c6469e912f25208c..69d5719aee862f5bb836a3c487423a04f3dc0a70 100644 (file)
@@ -803,10 +803,13 @@ void testColumn( uint8_t strobe )
                                                print(" ");
                                        }
 
-                                       // Only add the key to the buffer once
-                                       // NOTE: Buffer can easily handle multiple adds, just more efficient
-                                       //        and nicer debug messages :P
-                                       Macro_bufferAdd( key );
+                                       // Initial Keypress
+                                       Macro_keyState( key, 0x01 );
+                               }
+                               else if ( keys_debounce[key] >= DEBOUNCE_THRESHOLD )
+                               {
+                                       // Held Key
+                                       Macro_keyState( key, 0x02 );
                                }
 
                                keys_debounce[key]++;
@@ -840,10 +843,10 @@ void testColumn( uint8_t strobe )
                // Clear debounce entry if no keypress detected
                else
                {
-                       // If the key was previously pressed, remove from the buffer
+                       // Release Key
                        if ( KeyIndex_BufferUsed > 0 && keys_debounce[key] >= DEBOUNCE_THRESHOLD )
                        {
-                               Macro_bufferRemove( key );
+                               Macro_keyState( key, 0x03 );
                        }
 
                        // Clear debounce entry