From f0bf978454bccd57e4ea4903e9b84bba55b49121 Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Fri, 17 Nov 2023 12:01:02 -0600 Subject: [PATCH] custom key mappings --- apps/main/key_handler.cpp | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/main/key_handler.cpp b/apps/main/key_handler.cpp index f406f61..b742f20 100644 --- a/apps/main/key_handler.cpp +++ b/apps/main/key_handler.cpp @@ -150,28 +150,7 @@ void app_key_double_tap(APP_KEY_STATUS *status, void *param) { if (!app_tws_ibrt_tws_link_connected()) { // No other bud paired TRACE(0, "Handling %s in single bud mode", __func__); - send_next_track(); - } else { - // Bud's are working as a pair - if (app_tws_is_left_side()) { - TRACE(0, "Handling %s as left bud", __func__); - // Lefty - send_prev_track(); - } else { - TRACE(0, "Handling %s as right bud", __func__); - // Righty - send_next_track(); - } - } -} - -void app_key_triple_tap(APP_KEY_STATUS *status, void *param) { - TRACE(2, "%s event %d", __func__, status->event); - - if (!app_tws_ibrt_tws_link_connected()) { - // No other bud paired - TRACE(0, "Handling %s in single bud mode", __func__); - send_vol_up(); + send_vol_down(); } else { // Bud's are working as a pair if (app_tws_is_left_side()) { @@ -185,7 +164,28 @@ void app_key_triple_tap(APP_KEY_STATUS *status, void *param) { } } } -void app_key_quad_tap(APP_KEY_STATUS *status, void *param) { + +void app_key_triple_tap(APP_KEY_STATUS *status, void *param) { + TRACE(2, "%s event %d", __func__, status->event); + + if (!app_tws_ibrt_tws_link_connected()) { + // No other bud paired + TRACE(0, "Handling %s in single bud mode", __func__); + send_vol_up(); + }/* else { + // Bud's are working as a pair + if (app_tws_is_left_side()) { + TRACE(0, "Handling %s as left bud", __func__); + // Lefty + send_vol_down(); + } else { + TRACE(0, "Handling %s as right bud", __func__); + // Righty + send_vol_up(); + } + }*/ +} +/*void app_key_quad_tap(APP_KEY_STATUS *status, void *param) { TRACE(2, "%s event %d", __func__, status->event); if (!app_tws_ibrt_tws_link_connected()) { @@ -202,7 +202,7 @@ void app_key_quad_tap(APP_KEY_STATUS *status, void *param) { // Righty } } -} +}*/ void app_key_long_press_down(APP_KEY_STATUS *status, void *param) { TRACE(2, "%s event %d", __func__, status->event); @@ -210,7 +210,7 @@ void app_key_long_press_down(APP_KEY_STATUS *status, void *param) { if (!app_tws_ibrt_tws_link_connected()) { // No other bud paired TRACE(0, "Handling %s in single bud mode", __func__); - send_prev_track(); + //send_prev_track(); } else { // Bud's are working as a pair send_enable_disable_anc(); @@ -237,10 +237,10 @@ void app_key_init(void) { "", app_key_triple_tap, NULL}, - {{APP_KEY_CODE_PWR, APP_KEY_EVENT_ULTRACLICK}, + /*{{APP_KEY_CODE_PWR, APP_KEY_EVENT_ULTRACLICK}, "", app_key_quad_tap, - NULL}, + NULL},*/ {{APP_KEY_CODE_PWR, APP_KEY_EVENT_LONGPRESS}, "", app_key_long_press_down,