summaryrefslogtreecommitdiff
path: root/app/src/behaviors/behavior_hold_tap.c
diff options
context:
space:
mode:
authorOkke Formsma <okke@formsma.nl>2020-12-18 14:24:28 +0100
committerPete Johanson <peter@peterjohanson.com>2021-01-01 23:07:54 -0500
commitfa07ba9d32ab65c4443f1b315beff621c8cf0a9a (patch)
tree4dcc4bea01d30b0502367712fd08d78602f71182 /app/src/behaviors/behavior_hold_tap.c
parentcaa285852adc2d18ebd925171d11d0fd20d88dc8 (diff)
refactor(behaviors): use ZMK_BEHAVIOR_OPAQUE and ZMK_BEHAVIOR_TRANSPARENT
Use these instead of the magic return values 0 and 1 for behavior_driver_api return values.
Diffstat (limited to 'app/src/behaviors/behavior_hold_tap.c')
-rw-r--r--app/src/behaviors/behavior_hold_tap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c
index 7ad1d32..9b62eb1 100644
--- a/app/src/behaviors/behavior_hold_tap.c
+++ b/app/src/behaviors/behavior_hold_tap.c
@@ -310,7 +310,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding,
if (undecided_hold_tap != NULL) {
LOG_DBG("ERROR another hold-tap behavior is undecided.");
// if this happens, make sure the behavior events occur AFTER other position events.
- return 0;
+ return ZMK_BEHAVIOR_OPAQUE;
}
struct active_hold_tap *hold_tap =
@@ -318,7 +318,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding,
if (hold_tap == NULL) {
LOG_ERR("unable to store hold-tap info, did you press more than %d hold-taps?",
ZMK_BHV_HOLD_TAP_MAX_HELD);
- return 0;
+ return ZMK_BEHAVIOR_OPAQUE;
}
LOG_DBG("%d new undecided hold_tap", event.position);
@@ -331,7 +331,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding,
k_delayed_work_submit(&hold_tap->work, K_MSEC(tapping_term_ms_left));
}
- return 0;
+ return ZMK_BEHAVIOR_OPAQUE;
}
static int on_hold_tap_binding_released(struct zmk_behavior_binding *binding,
@@ -339,7 +339,7 @@ static int on_hold_tap_binding_released(struct zmk_behavior_binding *binding,
struct active_hold_tap *hold_tap = find_hold_tap(event.position);
if (hold_tap == NULL) {
LOG_ERR("ACTIVE_HOLD_TAP_CLEANED_UP_TOO_EARLY");
- return 0;
+ return ZMK_BEHAVIOR_OPAQUE;
}
// If these events were queued, the timer event may be queued too late or not at all.
@@ -379,7 +379,7 @@ static int on_hold_tap_binding_released(struct zmk_behavior_binding *binding,
clear_hold_tap(hold_tap);
}
- return 0;
+ return ZMK_BEHAVIOR_OPAQUE;
}
static const struct behavior_driver_api behavior_hold_tap_driver_api = {