diff options
author | Joshua T <joshua@sonofone.net> | 2016-10-15 22:14:10 +0200 |
---|---|---|
committer | Joshua T <joshua@sonofone.net> | 2016-10-15 22:14:10 +0200 |
commit | 2e6a1a53d73607030c470b88d3ed7223db5e0004 (patch) | |
tree | fd8ff310f0dba21f9135cdead49482af2276329b /quantum/process_keycode | |
parent | 5520b0022fc6cd3dff805eb31ed4bb7e4385ee2a (diff) | |
parent | 0a9ad8f335f5b5b9d184d9e5e9ece6cda149df7e (diff) | |
download | qmk_firmware-2e6a1a53d73607030c470b88d3ed7223db5e0004.tar.gz qmk_firmware-2e6a1a53d73607030c470b88d3ed7223db5e0004.tar.xz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r-- | quantum/process_keycode/process_midi.c | 4 | ||||
-rw-r--r-- | quantum/process_keycode/process_tap_dance.c | 6 | ||||
-rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 10 | ||||
-rw-r--r-- | quantum/process_keycode/process_unicode.c | 1 |
4 files changed, 14 insertions, 7 deletions
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 8784e64f3..577dad43a 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -7,7 +7,9 @@ int midi_offset = 7; bool process_midi(uint16_t keycode, keyrecord_t *record) { if (keycode == MI_ON && record->event.pressed) { midi_activated = true; +#ifdef AUDIO_ENABLE music_scale_user(); +#endif return false; } @@ -63,4 +65,4 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { return false; } return true; -}
\ No newline at end of file +} diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 07de3ecb8..6ae362c4c 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -65,11 +65,12 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { highest_td = idx; action = &tap_dance_actions[idx]; - action->state.keycode = keycode; action->state.pressed = record->event.pressed; if (record->event.pressed) { + action->state.keycode = keycode; action->state.count++; action->state.timer = timer_read(); + process_tap_dance_action_on_each_tap (action); if (last_td && last_td != keycode) { qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE]; @@ -77,8 +78,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { process_tap_dance_action_on_dance_finished (paction); reset_tap_dance (&paction->state); } + + last_td = keycode; } - last_td = keycode; break; diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index d7b857bdc..f753cbba6 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -39,15 +39,17 @@ typedef struct #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ .fn = { NULL, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \ - .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }) \ + .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }), \ } #define ACTION_TAP_DANCE_FN(user_fn) { \ - .fn = { NULL, user_fn, NULL } \ + .fn = { NULL, user_fn, NULL }, \ + .user_data = NULL, \ } -#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset) { \ - .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ +#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) { \ + .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \ + .user_data = NULL, \ } extern qk_tap_dance_action_t tap_dance_actions[]; diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index a5d7dca21..6a30afe29 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -2,6 +2,7 @@ static uint8_t input_mode; +__attribute__((weak)) uint16_t hex_to_keycode(uint8_t hex) { if (hex == 0x0) { |