You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
Alteration (enhancement/optimization) of existing feature(s)
New behavior
Description
Problem: Alot of people do complain about spacebar-chattering on their keyboards while the rest of the keys do work fine (me too ;-). It seems as this is a specific problem on brown switches, and it seems as it is not only one keyboard brand which is affected (search for reddit discussions. You'll find them), It also happens on brand-new keyboards.
Solution/Feature request: I would like to enhance the per-key debouncing with the option of an extended debounce time for specific keys like the spacebar.
Example code in sym_defer_pk.c
// Extended debounce for specific keys (e.g. spacebar)#ifndefDEBOUNCE_EXTENDED# defineDEBOUNCE_EXTENDED 5
#endif// Maximum debounce: 255ms#ifDEBOUNCE_EXTENDED>UINT8_MAX# undef DEBOUNCE_EXTENDED
# defineDEBOUNCE_EXTENDED UINT8_MAX
#endif// Extended debounce on specific keys (default: false)// Example: debouncing keys in matrix row 0, column 0 and row 1, column 1:// # define DEBOUNCE_EXTENDED_KEYS(row, col) ((row == 0 && col == 0) || (row == 1 && col == 1))#ifndefDEBOUNCE_EXTENDED_KEYS# defineDEBOUNCE_EXTENDED_KEYS(row, col) (false)
#endif
the operation start_debounce_counters has to be enhanced with a if-statement:
staticvoidstart_debounce_counters(matrix_row_traw[], matrix_row_tcooked[], uint8_tnum_rows) {
debounce_counter_t*debounce_pointer=debounce_counters;
for (uint8_trow=0; row<num_rows; row++) {
matrix_row_tdelta=raw[row] ^ cooked[row];
for (uint8_tcol=0; col<MATRIX_COLS; col++) {
if (delta& (ROW_SHIFTER << col)) {
if (*debounce_pointer==DEBOUNCE_ELAPSED) {
// enhanced debouncing for specific keysif (DEBOUNCE_EXTENDED_KEYS(row, col)) {
*debounce_pointer=DEBOUNCE_EXTENDED;
} else {
*debounce_pointer=DEBOUNCE;
}
counters_need_update= true;
}
} else {
*debounce_pointer=DEBOUNCE_ELAPSED;
}
debounce_pointer++;
}
}
}
I guess the compiler will remove the "dead parts" in the case if it is statically set to false.
It can be used in sym_eager_pk.c too. I'm not sure if it makes sense in asym_eager_defer_pk.c though.
The text was updated successfully, but these errors were encountered:
An actual user function like bool extended_debounce(uint8_t row, uint8_t col) (instead of DEBOUNCE_EXTENDED_KEYS(row, col)) will be safer while avoiding the pitfalls of a complex preprocessor macro. Proper preprocessor guards like the examples in PR 24560 will avoid any code bloat when the feature is not activated.
Feature Request Type
Description
Problem: Alot of people do complain about spacebar-chattering on their keyboards while the rest of the keys do work fine (me too ;-). It seems as this is a specific problem on brown switches, and it seems as it is not only one keyboard brand which is affected (search for reddit discussions. You'll find them), It also happens on brand-new keyboards.
Solution/Feature request: I would like to enhance the per-key debouncing with the option of an extended debounce time for specific keys like the spacebar.
Example code in
sym_defer_pk.c
the operation
start_debounce_counters
has to be enhanced with a if-statement:I guess the compiler will remove the "dead parts" in the case if it is statically set to
false
.It can be used in
sym_eager_pk.c
too. I'm not sure if it makes sense inasym_eager_defer_pk.c
though.The text was updated successfully, but these errors were encountered: