You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
2.4 KiB

  1. # Debounce algorithm
  2. QMK supports multiple debounce algorithms through its debounce API.
  3. The logic for which debounce method called is below. It checks various defines that you have set in rules.mk
  4. ```
  5. DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce
  6. DEBOUNCE_TYPE?= sym_g
  7. ifneq ($(strip $(DEBOUNCE_TYPE)), custom)
  8. QUANTUM_SRC += $(DEBOUNCE_DIR)/$(strip $(DEBOUNCE_TYPE)).c
  9. endif
  10. ```
  11. # Debounce selection
  12. | DEBOUNCE_TYPE | Description | What else is needed |
  13. | ------------- | --------------------------------------------------- | ----------------------------- |
  14. | Not defined | Use the default algorithm, currently sym_g | Nothing |
  15. | custom | Use your own debounce.c | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions |
  16. | anything_else | Use another algorithm from quantum/debounce/* | Nothing |
  17. **Regarding split keyboards**:
  18. The debounce code is compatible with split keyboards.
  19. # Use your own debouncing code
  20. * Set ```DEBOUNCE_TYPE = custom ```.
  21. * Add ```SRC += debounce.c```
  22. * Add your own ```debounce.c```. Look at current implementations in ```quantum/debounce``` for examples.
  23. * Debouncing occurs after every raw matrix scan.
  24. * Use num_rows rather than MATRIX_ROWS, so that split keyboards are supported correctly.
  25. # Changing between included debouncing methods
  26. You can either use your own code, by including your own debounce.c, or switch to another included one.
  27. Included debounce methods are:
  28. * eager_pr - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE_DELAY``` milliseconds of no further input for that row.
  29. For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be
  30. appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use.
  31. * eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE_DELAY``` milliseconds of no further input for that key
  32. * sym_g - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE_DELAY``` milliseconds of no changes has occured, all input changes are pushed.