kopia lustrzana https://github.com/OpenRTX/OpenRTX
ttwrplus: Slow down encoder input
Two ticks are needed to emit one KNOB_LEFT or KNOB_RIGHT event, thus slowing down the rotary encoder input and making it more comfortable. TG-553pull/193/head
rodzic
fe027c440c
commit
7619b9473b
|
@ -85,9 +85,9 @@ keyboard_t kbd_getKeys()
|
|||
int8_t delta = new_pos - old_pos;
|
||||
|
||||
// Normal case: handle up/down by looking at the pulse difference
|
||||
if(delta > 0)
|
||||
if(delta > 0 && new_pos % 2 == 0)
|
||||
keys |= KNOB_LEFT;
|
||||
else if (delta < 0)
|
||||
else if (delta < 0 && new_pos % 2 != 0)
|
||||
keys |= KNOB_RIGHT;
|
||||
|
||||
// Corner case 1: rollover from negative (old) to positive (new) value.
|
||||
|
|
Ładowanie…
Reference in New Issue