Selaa lähdekoodia

Merge branch 'tapping_fix60'

led_matrix
tmk 10 vuotta sitten
vanhempi
commit
58ca7b904b
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7
    4
      common/action_tapping.c

+ 7
- 4
common/action_tapping.c Näytä tiedosto

static bool process_tapping(keyrecord_t *record); static bool process_tapping(keyrecord_t *record);
static bool waiting_buffer_enq(keyrecord_t record); static bool waiting_buffer_enq(keyrecord_t record);
static void waiting_buffer_clear(void); static void waiting_buffer_clear(void);
#if TAPPING_TERM >= 500
static bool waiting_buffer_typed(keyevent_t event); static bool waiting_buffer_typed(keyevent_t event);
#endif
static bool waiting_buffer_has_anykey_pressed(void); static bool waiting_buffer_has_anykey_pressed(void);
static void waiting_buffer_scan_tap(void); static void waiting_buffer_scan_tap(void);
static void debug_tapping_key(void); static void debug_tapping_key(void);
return false; return false;
} }
#endif #endif
/* release a key pressed before tapping */
else if (!event.pressed && !waiting_buffer_typed(event)) {
/* Unexpected repeating occurs unless this event is processed immedately. */
debug("Tapping: release a key pressed before tapping\n");
process_action(keyp);
return true;
}
else { else {
// set interrupted flag when other key preesed during tapping // set interrupted flag when other key preesed during tapping
if (event.pressed) { if (event.pressed) {
waiting_buffer_tail = 0; waiting_buffer_tail = 0;
} }


#if TAPPING_TERM >= 500
bool waiting_buffer_typed(keyevent_t event) bool waiting_buffer_typed(keyevent_t event)
{ {
for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
} }
return false; return false;
} }
#endif


bool waiting_buffer_has_anykey_pressed(void) bool waiting_buffer_has_anykey_pressed(void)
{ {