re-order function definitions
This commit is contained in:
parent
a26e001bfd
commit
45721afcf9
1 changed files with 12 additions and 12 deletions
|
@ -274,15 +274,25 @@ static void decide_hold_preferred(struct active_hold_tap *hold_tap, enum decisio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool does_pressed_key_trigger_hold(struct active_hold_tap *hold_tap, int32_t other_key_down_position) {
|
||||||
|
for (int i = 0; i < hold_tap->config->hold_trigger_key_positions_len; i++) {
|
||||||
|
if (hold_tap->config->hold_trigger_key_positions[i] ==
|
||||||
|
other_key_down_position) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static void decide_tap_positionally_preferred(struct active_hold_tap *hold_tap,
|
static void decide_tap_positionally_preferred(struct active_hold_tap *hold_tap,
|
||||||
enum decision_moment event,
|
enum decision_moment event,
|
||||||
int32_t other_key_down_position) {
|
int32_t pressed_key_position) {
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case HT_KEY_UP:
|
case HT_KEY_UP:
|
||||||
hold_tap->status = STATUS_TAP;
|
hold_tap->status = STATUS_TAP;
|
||||||
return;
|
return;
|
||||||
case HT_OTHER_KEY_DOWN:
|
case HT_OTHER_KEY_DOWN:
|
||||||
hold_tap->status = is_other_key_trigger_key(hold_tap, other_key_down_position) ? STATUS_HOLD_INTERRUPT : STATUS_TAP;
|
hold_tap->status = does_pressed_key_trigger_hold(hold_tap, pressed_key_position) ? STATUS_HOLD_INTERRUPT : STATUS_TAP;
|
||||||
return;
|
return;
|
||||||
case HT_TIMER_EVENT:
|
case HT_TIMER_EVENT:
|
||||||
hold_tap->status = STATUS_TAP;
|
hold_tap->status = STATUS_TAP;
|
||||||
|
@ -295,16 +305,6 @@ static void decide_tap_positionally_preferred(struct active_hold_tap *hold_tap,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_other_key_trigger_key(struct active_hold_tap *hold_tap, int32_t other_key_down_position) {
|
|
||||||
for (int i = 0; i < hold_tap->config->hold_trigger_key_positions_len; i++) {
|
|
||||||
if (hold_tap->config->hold_trigger_key_positions[i] ==
|
|
||||||
other_key_down_position) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline const char *flavor_str(enum flavor flavor) {
|
static inline const char *flavor_str(enum flavor flavor) {
|
||||||
switch (flavor) {
|
switch (flavor) {
|
||||||
case FLAVOR_HOLD_PREFERRED:
|
case FLAVOR_HOLD_PREFERRED:
|
||||||
|
|
Loading…
Add table
Reference in a new issue