12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "quantum.h"
- #include "process_dynamic_tapping_term.h"
- #ifndef DYNAMIC_TAPPING_TERM_INCREMENT
- # define DYNAMIC_TAPPING_TERM_INCREMENT 5
- #endif
- static void tapping_term_report(void) {
- #ifdef SEND_STRING_ENABLE
- const char *tapping_term_str = get_u16_str(g_tapping_term, ' ');
-
- while (*tapping_term_str == ' ') {
- tapping_term_str++;
- }
- send_string(tapping_term_str);
- #endif
- }
- bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
- switch (keycode) {
- case DT_PRNT:
- tapping_term_report();
- return false;
- case DT_UP:
- g_tapping_term += DYNAMIC_TAPPING_TERM_INCREMENT;
- return false;
- case DT_DOWN:
- g_tapping_term -= DYNAMIC_TAPPING_TERM_INCREMENT;
- return false;
- }
- }
- return true;
- }
|