/* define if matrix has ghost */\r
#define MATRIX_HAS_GHOST\r
/* Set 0 if need no debouncing */\r
-#define DEBOUNCE 0\r
+#define DEBOUNCE 5\r
\r
\r
/* key combination for command */\r
matrix[i] = ~read_col(i) | 0b00010000; // send fake caps lock down
}
} else { // CAPS LOCK is OFF on HOST
- matrix[i] = ~read_col(i);
+ if (matrix[i] != (uint8_t)~read_col(i)) {
+ matrix[i] = (uint8_t)~read_col(i);
+ if (debouncing) {
+ debug("bounce!: "); debug_hex(debouncing); print("\n");
+ }
+ debouncing = DEBOUNCE;
+ }
}
} else {
if (matrix[i] != (uint8_t)~read_col(i)) {
matrix[i] = (uint8_t)~read_col(i);
+ if (debouncing) {
+ debug("bounce!: "); debug_hex(debouncing); print("\n");
+ }
+ debouncing = DEBOUNCE;
}
}
- if (debouncing) {
- debug("bounce!: "); debug_hex(debouncing); print("\n");
- }
- debouncing = DEBOUNCE;
}
unselect_rows();
tmp |= (PINF >> 1 ) & 0b00001000; // LEFT GUI is 3bit in modifier (HID Spec)
tmp |= (PINA << 4 ) & 0b00010000; // CAPSLOCK
tmp |= (PINB << 3 ) & 0b00100000; // POWER
- //tmp |= (PINE << 1 ) & 0b00010000; // Caps Lock(Should not be in modifier
} else {
tmp = 0x00;
tmp = (PINE >> 1)&0b00000001;