// Scan Module command dictionary
-char* scanCLIDictName = "DPH Module Commands";
-CLIDictItem scanCLIDict[] = {
+const char scanCLIDictName[] = "DPH Module Commands";
+const CLIDictItem scanCLIDict[] = {
{ "echo", "Example command, echos the arguments.", cliFunc_echo },
{ "avgDebug", "Enables/Disables averaging results." NL "\t\tDisplays each average, starting from Key 0x00, ignoring 0 valued averages.", cliFunc_avgDebug },
{ "keyDebug", "Enables/Disables long debug for each keypress." NL "\t\tkeycode - [strobe:mux] : sense val : threshold+delta=total : margin", cliFunc_keyDebug },
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]++;
// 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