From 145067632f5da1d9307c387eb463f31dd6ef9ca1 Mon Sep 17 00:00:00 2001 From: Derek Jamison Date: Sun, 26 Nov 2023 10:23:45 -0600 Subject: [PATCH] Update iOS18 instructions + stop timer on BACK button. --- hid/hid_cookie/hid.c | 3 +++ hid/hid_cookie/views/hid_cc.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/hid/hid_cookie/hid.c b/hid/hid_cookie/hid.c index f3c3965..0952ba7 100644 --- a/hid/hid_cookie/hid.c +++ b/hid/hid_cookie/hid.c @@ -151,6 +151,9 @@ Hid* hid_app_alloc_view(void* context) { 0, 128, 64, + "iOS18:Settings/Accessibility\n" + "/AssistiveTouch=ON. Single-\n" + "Tap=Pass Through to App.\n\n" "While this app is running, go to\n" "your phone's bluetooth\n" "settings and discover devices.\n" diff --git a/hid/hid_cookie/views/hid_cc.c b/hid/hid_cookie/views/hid_cc.c index 989a193..57173f8 100644 --- a/hid/hid_cookie/views/hid_cc.c +++ b/hid/hid_cookie/views/hid_cc.c @@ -210,6 +210,13 @@ static bool hid_cc_input_callback(InputEvent* event, void* context) { return consumed; } +void hid_cc_exit_callback(void* context) { + furi_assert(context); + HidCC* hid_cc = context; + with_view_model( + hid_cc->view, HidCCModel * model, { model->timer_click_enabled = false; }, true); +} + void hid_cc_set_cursor_position(HidCC* hid_cc, uint8_t x, uint8_t y, uint8_t repeat, uint8_t speed) { furi_assert(hid_cc); with_view_model( @@ -232,6 +239,7 @@ HidCC* hid_cc_alloc(Hid* bt_hid) { view_allocate_model(hid_cc->view, ViewModelTypeLocking, sizeof(HidCCModel)); view_set_draw_callback(hid_cc->view, hid_cc_draw_callback); view_set_input_callback(hid_cc->view, hid_cc_input_callback); + view_set_exit_callback(hid_cc->view, hid_cc_exit_callback); with_view_model( hid_cc->view, @@ -247,6 +255,7 @@ HidCC* hid_cc_alloc(Hid* bt_hid) { void hid_cc_free(HidCC* hid_cc) { furi_assert(hid_cc); + furi_timer_stop(hid_cc->timer); furi_timer_free(hid_cc->timer); view_free(hid_cc->view); free(hid_cc);