3 QMK supports multiple debounce algorithms through its debounce API.
5 The underlying debounce algorithm is determined by which matrix.c file you are using.
7 The logic for which debounce method called is below. It checks various defines that you have set in rules.mk
10 ifeq ($(strip $(DEBOUNCE_ALGO)), manual)
11 # Do nothing. do your debouncing in matrix.c
12 else ifeq ($(strip $(DEBOUNCE_ALGO)), sym_g)
13 QUANTUM_SRC += $(DEBOUNCE)/debounce_sym_g.c
14 else ifeq ($(strip $(DEBOUNCE_ALGO)), eager_pk)
15 QUANTUM_SRC += $(DEBOUNCE)/debounce_eager_pk.c
16 else # default algorithm
17 QUANTUM_SRC += $(DEBOUNCE)/debounce_sym_g.c
23 | DEBOUNCE_ALGO | Description | What to do |
24 | ------------- | --------------------------------------------------- | ----------------------------- |
25 | Not defined | You are using the included matrix.c and debounce.c | Nothing. Debounce_sym_g will be compiled, and used if necessary |
26 | manual | Use your own debounce.c | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions |
27 | sym_g / eager_pk | You are using the included matrix.c and debounce.c | Use an alternative debounce algorithm |
29 **Regarding split keyboards**:
30 The debounce code is compatible with split keyboards.
32 # Use your own debouncing code
33 * Set ```DEBOUNCE_ALGO = manual```.
34 * Add ```SRC += debounce.c```
35 * Add your own ```debounce.c```. Look at included ```debounce_sym_g.c```s for sample implementations.
36 * Debouncing occurs after every raw matrix scan.
38 # Changing between included debouncing methods
39 You can either use your own code, by including your own debounce.c, or switch to another included one.
40 Included debounce methods are:
41 * debounce_eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE_DELAY``` millseconds of no further input for that key
42 * debounce_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.