Skip to content

Commit

Permalink
don't hide cursor when pressing arrow keys in soft keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Sep 7, 2023
1 parent 3467adb commit 79f925d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/app/lvgl/input/lv_drv_sdl_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion third_party/commons

0 comments on commit 79f925d

Please sign in to comment.