From 79f925d42c5faf4d26159a05454904cbca4382bf Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Thu, 7 Sep 2023 23:40:17 +0900 Subject: [PATCH] don't hide cursor when pressing arrow keys in soft keyboard --- src/app/lvgl/input/lv_drv_sdl_key.c | 10 ++++++---- third_party/commons | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/lvgl/input/lv_drv_sdl_key.c b/src/app/lvgl/input/lv_drv_sdl_key.c index 6578da09c..845dd8936 100644 --- a/src/app/lvgl/input/lv_drv_sdl_key.c +++ b/src/app/lvgl/input/lv_drv_sdl_key.c @@ -17,7 +17,7 @@ static bool read_keyboard(app_ui_input_t *input, const SDL_KeyboardEvent *event, static bool read_webos_key(app_ui_input_t *input, const SDL_KeyboardEvent *event, lv_drv_sdl_key_t *state); -static void webos_key_input_mode(const SDL_KeyboardEvent *event); +static void webos_key_input_mode(app_ui_input_t *input, const SDL_KeyboardEvent *event); #endif @@ -59,7 +59,7 @@ static void sdl_input_read(lv_indev_drv_t *drv, lv_indev_data_t *data) { } } else if (SDL_PeepEvents(&e, 1, SDL_GETEVENT, SDL_KEYDOWN, SDL_KEYUP) > 0) { #if TARGET_WEBOS - webos_key_input_mode(&e.key); + webos_key_input_mode(input, &e.key); #endif if (app->session != NULL && session_handle_input_event(app->session, &e)) { state->state = LV_INDEV_STATE_RELEASED; @@ -230,13 +230,15 @@ static bool read_webos_key(app_ui_input_t *input, const SDL_KeyboardEvent *event } } -static void webos_key_input_mode(const SDL_KeyboardEvent *event) { +static void webos_key_input_mode(app_ui_input_t *input, const SDL_KeyboardEvent *event) { switch (event->keysym.sym) { case SDLK_UP: case SDLK_DOWN: case SDLK_LEFT: case SDLK_RIGHT: { - SDL_webOSCursorVisibility(SDL_FALSE); + if (!SDL_IsScreenKeyboardShown(input->ui->window)) { + SDL_webOSCursorVisibility(SDL_FALSE); + } break; } default: diff --git a/third_party/commons b/third_party/commons index 97d5e8d25..ed8add026 160000 --- a/third_party/commons +++ b/third_party/commons @@ -1 +1 @@ -Subproject commit 97d5e8d2591f0bc019d5ea62e72c457c002f89bc +Subproject commit ed8add026b56187cca29b5867e5307717926d09d