diff options
author | Stick <nstickney@gmail.com> | 2017-06-02 19:50:54 -0500 |
---|---|---|
committer | Stick <nstickney@gmail.com> | 2017-06-02 19:50:54 -0500 |
commit | 4ba9917f829885b13ea1b3610a2f988e539c9e01 (patch) | |
tree | 612da1c6de929e6e0a5b0847d7b594cb3becdf27 /quantum/process_keycode | |
parent | 8665ed3efc62e649d0eac5b88761d7b3f8f30cd7 (diff) | |
parent | aaa67f69305c5c78e15a1090ba7058adea59ff36 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r-- | quantum/process_keycode/process_tap_dance.c | 14 | ||||
-rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 7 | ||||
-rw-r--r-- | quantum/process_keycode/process_unicodemap.c | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index b807ec3c30..4fd45810bb 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -127,14 +127,22 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { return true; } + + void matrix_scan_tap_dance () { if (highest_td == -1) return; + uint16_t tap_user_defined; -for (int i = 0; i <= highest_td; i++) { +for (uint8_t i = 0; i <= highest_td; i++) { qk_tap_dance_action_t *action = &tap_dance_actions[i]; - - if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) { + if(action->custom_tapping_term > 0 ) { + tap_user_defined = action->custom_tapping_term; + } + else{ + tap_user_defined = TAPPING_TERM; + } + if (action->state.count && timer_elapsed (action->state.timer) > tap_user_defined) { process_tap_dance_action_on_dance_finished (action); reset_tap_dance (&action->state); } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 330809f83a..f42c154a05 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -44,6 +44,7 @@ typedef struct qk_tap_dance_user_fn_t on_reset; } fn; qk_tap_dance_state_t state; + uint16_t custom_tapping_term; void *user_data; } qk_tap_dance_action_t; @@ -68,6 +69,12 @@ typedef struct .user_data = NULL, \ } +#define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) { \ + .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \ + .user_data = NULL, \ + .custom_tapping_term = tap_specific_tapping_term, \ + } + extern qk_tap_dance_action_t tap_dance_actions[]; /* To be used internally */ diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index 0227fbdd7b..75f35112b1 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c @@ -49,7 +49,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { const uint32_t* map = unicode_map; uint16_t index = keycode - QK_UNICODE_MAP; - uint32_t code = pgm_read_dword_far(&map[index]); + uint32_t code = pgm_read_dword(&map[index]); if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) { // Convert to UTF-16 surrogate pair code -= 0x10000; |