From 2f56d5f2d65296e785371bda1ebd8d3f95684f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 2 Nov 2015 01:05:33 +0700 Subject: [PATCH 1/3] (Menu) Refactor pointer_tap --- menu/menu_input.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/menu/menu_input.c b/menu/menu_input.c index 3bfc5b5de2..8c49c26b1b 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -1016,18 +1016,28 @@ static int pointer_tap(menu_file_list_cbs_t *cbs, menu_entry_t *entry, unsigned action) { size_t selection, idx; + unsigned header_height; bool scroll = false; menu_input_t *menu_input = menu_input_get_ptr(); menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); + menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); - if (menu_input->pointer.ptr == selection && cbs && cbs->action_select) - return menu_entry_action(entry, selection, MENU_ACTION_SELECT); + if ((unsigned)menu_input->pointer.start_y < header_height) + { + menu_entries_pop_stack(&selection, 0); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); + } + else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) + { + if (menu_input->pointer.ptr == selection && cbs && cbs->action_select) + return menu_entry_action(entry, selection, MENU_ACTION_SELECT); - idx = menu_input->pointer.ptr; + idx = menu_input->pointer.ptr; - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx); - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); + } return 0; } @@ -1151,18 +1161,7 @@ static int menu_input_pointer_post_iterate(menu_file_list_cbs_t *cbs, if (menu_input->pointer.oldpressed[0]) { if (!menu_input->pointer.dragging) - { - if ((unsigned)menu_input->pointer.start_y < header_height) - { - menu_entries_pop_stack(&selection, 0); - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); - } - else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) - { - menu_input->pointer.oldpressed[0] = false; - ret = pointer_tap(cbs, entry, action); - } - } + ret = pointer_tap(cbs, entry, action); menu_input->pointer.oldpressed[0] = false; menu_input->pointer.start_x = 0; From bd99e952d6a3ac2ca6a830fda4fb8f8abc1a946b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 2 Nov 2015 01:17:06 +0700 Subject: [PATCH 2/3] (Menu) Move pointer_tap on the menu driver side --- menu/drivers/glui.c | 31 +++++++++ menu/drivers/null.c | 1 + menu/drivers/rgui.c | 31 +++++++++ menu/drivers/rmenu.c | 1 + menu/drivers/rmenu_xui.cpp | 1 + menu/drivers/xmb.c | 31 +++++++++ menu/drivers/zarch.c | 1 + menu/menu_driver.c | 13 +++- menu/menu_driver.h | 5 ++ menu/menu_input.c | 136 +------------------------------------ menu/menu_input.h | 104 ++++++++++++++++++++++++++++ 11 files changed, 220 insertions(+), 135 deletions(-) diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index e70a13cde7..e0300103d1 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -1399,6 +1399,36 @@ static size_t glui_list_get_selection(void *data) return glui->categories.selection_ptr; } +static int glui_pointer_tap(menu_file_list_cbs_t *cbs, + menu_entry_t *entry, unsigned action) +{ + size_t selection, idx; + unsigned header_height; + bool scroll = false; + menu_input_t *menu_input = menu_input_get_ptr(); + + menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); + menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); + + if ((unsigned)menu_input->pointer.start_y < header_height) + { + menu_entries_pop_stack(&selection, 0); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); + } + else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) + { + if (menu_input->pointer.ptr == selection && cbs && cbs->action_select) + return menu_entry_action(entry, selection, MENU_ACTION_SELECT); + + idx = menu_input->pointer.ptr; + + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); + } + + return 0; +} + menu_ctx_driver_t menu_ctx_glui = { NULL, glui_get_message, @@ -1433,4 +1463,5 @@ menu_ctx_driver_t menu_ctx_glui = { "glui", MENU_VIDEO_DRIVER_OPENGL, glui_environ, + glui_pointer_tap, }; diff --git a/menu/drivers/null.c b/menu/drivers/null.c index d8e464d01b..08e3c68d8e 100644 --- a/menu/drivers/null.c +++ b/menu/drivers/null.c @@ -57,4 +57,5 @@ menu_ctx_driver_t menu_ctx_null = { "null", MENU_VIDEO_DRIVER_GENERIC, NULL, + NULL, }; diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index f7209b82cb..4349579915 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -840,6 +840,36 @@ static int rgui_environ(menu_environ_cb_t type, void *data) return 0; } +static int rgui_pointer_tap(menu_file_list_cbs_t *cbs, + menu_entry_t *entry, unsigned action) +{ + size_t selection, idx; + unsigned header_height; + bool scroll = false; + menu_input_t *menu_input = menu_input_get_ptr(); + + menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); + menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); + + if ((unsigned)menu_input->pointer.start_y < header_height) + { + menu_entries_pop_stack(&selection, 0); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); + } + else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) + { + if (menu_input->pointer.ptr == selection && cbs && cbs->action_select) + return menu_entry_action(entry, selection, MENU_ACTION_SELECT); + + idx = menu_input->pointer.ptr; + + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); + } + + return 0; +} + menu_ctx_driver_t menu_ctx_rgui = { rgui_set_texture, rgui_set_message, @@ -874,4 +904,5 @@ menu_ctx_driver_t menu_ctx_rgui = { "rgui", MENU_VIDEO_DRIVER_GENERIC, rgui_environ, + rgui_pointer_tap, }; diff --git a/menu/drivers/rmenu.c b/menu/drivers/rmenu.c index 47e7506512..cd1637d89a 100644 --- a/menu/drivers/rmenu.c +++ b/menu/drivers/rmenu.c @@ -359,4 +359,5 @@ menu_ctx_driver_t menu_ctx_rmenu = { "rmenu", MENU_VIDEO_DRIVER_DIRECT3D, rmenu_environ, + NULL, }; diff --git a/menu/drivers/rmenu_xui.cpp b/menu/drivers/rmenu_xui.cpp index 4903fc8ebf..f05b256329 100644 --- a/menu/drivers/rmenu_xui.cpp +++ b/menu/drivers/rmenu_xui.cpp @@ -725,4 +725,5 @@ menu_ctx_driver_t menu_ctx_rmenu_xui = { "rmenu_xui", MENU_VIDEO_DRIVER_DIRECT3D, rmenu_xui_environ, + NULL, }; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 2e5263f24d..1958408462 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2721,6 +2721,36 @@ static bool xmb_menu_init_list(void *data) return true; } +static int xmb_pointer_tap(menu_file_list_cbs_t *cbs, + menu_entry_t *entry, unsigned action) +{ + size_t selection, idx; + unsigned header_height; + bool scroll = false; + menu_input_t *menu_input = menu_input_get_ptr(); + + menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); + menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); + + if ((unsigned)menu_input->pointer.start_y < header_height) + { + menu_entries_pop_stack(&selection, 0); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); + } + else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) + { + if (menu_input->pointer.ptr == selection && cbs && cbs->action_select) + return menu_entry_action(entry, selection, MENU_ACTION_SELECT); + + idx = menu_input->pointer.ptr; + + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); + } + + return 0; +} + menu_ctx_driver_t menu_ctx_xmb = { NULL, xmb_render_messagebox_internal, @@ -2755,4 +2785,5 @@ menu_ctx_driver_t menu_ctx_xmb = { "xmb", MENU_VIDEO_DRIVER_OPENGL, xmb_environ, + xmb_pointer_tap, }; diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 71df5ab258..558dd1d79a 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -1386,4 +1386,5 @@ menu_ctx_driver_t menu_ctx_zarch = { "zarch", MENU_VIDEO_DRIVER_OPENGL, NULL, + NULL, }; diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 2f0cd0deaa..d47a993c8d 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -379,7 +379,6 @@ bool menu_driver_load_image(void *data, menu_image_type_t type) return false; } - bool menu_environment_cb(menu_environ_cb_t type, void *data) { const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); @@ -393,3 +392,15 @@ bool menu_environment_cb(menu_environ_cb_t type, void *data) return false; } + +int menu_driver_pointer_tap(menu_file_list_cbs_t *cbs, + menu_entry_t *entry, unsigned action) +{ + int ret = 0; + const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); + + if (driver->pointer_tap) + ret = driver->pointer_tap(cbs, entry, action); + + return ret; +} diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 44499f15de..7eaac07ce9 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -142,6 +142,8 @@ typedef struct menu_ctx_driver const char *ident; menu_video_driver_type_t type; int (*environ_cb)(menu_environ_cb_t type, void *data); + int (*pointer_tap)(menu_file_list_cbs_t *cbs, + menu_entry_t *entry, unsigned action); } menu_ctx_driver_t; extern menu_ctx_driver_t menu_ctx_rmenu; @@ -228,6 +230,9 @@ int menu_driver_bind_init(menu_file_list_cbs_t *cbs, const char *elem0, const char *elem1, uint32_t label_hash, uint32_t menu_label_hash); +int menu_driver_pointer_tap(menu_file_list_cbs_t *cbs, + menu_entry_t *entry, unsigned action); + /* HACK */ extern unsigned int rdb_entry_start_game_selection_ptr; diff --git a/menu/menu_input.c b/menu/menu_input.c index 8c49c26b1b..3c34763573 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -40,108 +40,6 @@ #include "../input/input_remapping.h" #include "../input/input_common.h" -#define MENU_MAX_BUTTONS 219 -#define MENU_MAX_AXES 32 -#define MENU_MAX_HATS 4 - -unsigned bind_port; - -struct menu_bind_state_port -{ - bool buttons[MENU_MAX_BUTTONS]; - int16_t axes[MENU_MAX_AXES]; - uint16_t hats[MENU_MAX_HATS]; -}; - -struct menu_bind_axis_state -{ - /* Default axis state. */ - int16_t rested_axes[MENU_MAX_AXES]; - /* Locked axis state. If we configured an axis, - * avoid having the same axis state trigger something again right away. */ - int16_t locked_axes[MENU_MAX_AXES]; -}; - -struct menu_bind_state -{ - struct retro_keybind *target; - /* For keyboard binding. */ - int64_t timeout_end; - unsigned begin; - unsigned last; - unsigned user; - struct menu_bind_state_port state[MAX_USERS]; - struct menu_bind_axis_state axis_state[MAX_USERS]; - bool skip; -}; - -typedef struct menu_input_mouse -{ - int16_t x; - int16_t y; - bool left; - bool right; - bool oldleft; - bool oldright; - bool wheelup; - bool wheeldown; - bool hwheelup; - bool hwheeldown; - bool scrollup; - bool scrolldown; - unsigned ptr; - uint64_t state; -} menu_input_mouse_t; - -typedef struct menu_input -{ - struct menu_bind_state binds; - - bool bind_mode_keyboard; - - uint64_t devices_mask; - - menu_input_mouse_t mouse; - - struct - { - int16_t x; - int16_t y; - int16_t dx; - int16_t dy; - int16_t old_x; - int16_t old_y; - int16_t start_x; - int16_t start_y; - float accel; - float accel0; - float accel1; - bool pressed[2]; - bool oldpressed[2]; - bool dragging; - bool back; - bool oldback; - unsigned ptr; - } pointer; - - struct - { - const char **buffer; - const char *label; - const char *label_setting; - bool display; - unsigned type; - unsigned idx; - } keyboard; - - /* Used for key repeat */ - struct - { - float timer; - float count; - } delay; -} menu_input_t; - static menu_input_t menu_input_state; void menu_input_free(void) @@ -149,7 +47,7 @@ void menu_input_free(void) memset(&menu_input_state, 0, sizeof(menu_input_t)); } -static menu_input_t *menu_input_get_ptr(void) +menu_input_t *menu_input_get_ptr(void) { return &menu_input_state; } @@ -1012,36 +910,6 @@ static int menu_input_mouse_post_iterate(uint64_t *input_mouse, return 0; } -static int pointer_tap(menu_file_list_cbs_t *cbs, - menu_entry_t *entry, unsigned action) -{ - size_t selection, idx; - unsigned header_height; - bool scroll = false; - menu_input_t *menu_input = menu_input_get_ptr(); - - menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); - menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); - - if ((unsigned)menu_input->pointer.start_y < header_height) - { - menu_entries_pop_stack(&selection, 0); - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); - } - else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) - { - if (menu_input->pointer.ptr == selection && cbs && cbs->action_select) - return menu_entry_action(entry, selection, MENU_ACTION_SELECT); - - idx = menu_input->pointer.ptr; - - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx); - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); - } - - return 0; -} - int16_t menu_input_pointer_state(enum menu_input_pointer_state state) { menu_input_t *menu = menu_input_get_ptr(); @@ -1161,7 +1029,7 @@ static int menu_input_pointer_post_iterate(menu_file_list_cbs_t *cbs, if (menu_input->pointer.oldpressed[0]) { if (!menu_input->pointer.dragging) - ret = pointer_tap(cbs, entry, action); + ret = menu_driver_pointer_tap(cbs, entry, action); menu_input->pointer.oldpressed[0] = false; menu_input->pointer.start_x = 0; diff --git a/menu/menu_input.h b/menu/menu_input.h index 5085ff8b57..7c578b5a4f 100644 --- a/menu/menu_input.h +++ b/menu/menu_input.h @@ -105,6 +105,110 @@ enum menu_input_bind_mode MENU_INPUT_BIND_ALL }; +#define MENU_MAX_BUTTONS 219 +#define MENU_MAX_AXES 32 +#define MENU_MAX_HATS 4 + +unsigned bind_port; + +struct menu_bind_state_port +{ + bool buttons[MENU_MAX_BUTTONS]; + int16_t axes[MENU_MAX_AXES]; + uint16_t hats[MENU_MAX_HATS]; +}; + +struct menu_bind_axis_state +{ + /* Default axis state. */ + int16_t rested_axes[MENU_MAX_AXES]; + /* Locked axis state. If we configured an axis, + * avoid having the same axis state trigger something again right away. */ + int16_t locked_axes[MENU_MAX_AXES]; +}; + +struct menu_bind_state +{ + struct retro_keybind *target; + /* For keyboard binding. */ + int64_t timeout_end; + unsigned begin; + unsigned last; + unsigned user; + struct menu_bind_state_port state[MAX_USERS]; + struct menu_bind_axis_state axis_state[MAX_USERS]; + bool skip; +}; + +typedef struct menu_input_mouse +{ + int16_t x; + int16_t y; + bool left; + bool right; + bool oldleft; + bool oldright; + bool wheelup; + bool wheeldown; + bool hwheelup; + bool hwheeldown; + bool scrollup; + bool scrolldown; + unsigned ptr; + uint64_t state; +} menu_input_mouse_t; + +typedef struct menu_input +{ + struct menu_bind_state binds; + + bool bind_mode_keyboard; + + uint64_t devices_mask; + + menu_input_mouse_t mouse; + + struct + { + int16_t x; + int16_t y; + int16_t dx; + int16_t dy; + int16_t old_x; + int16_t old_y; + int16_t start_x; + int16_t start_y; + float accel; + float accel0; + float accel1; + bool pressed[2]; + bool oldpressed[2]; + bool dragging; + bool back; + bool oldback; + unsigned ptr; + } pointer; + + struct + { + const char **buffer; + const char *label; + const char *label_setting; + bool display; + unsigned type; + unsigned idx; + } keyboard; + + /* Used for key repeat */ + struct + { + float timer; + float count; + } delay; +} menu_input_t; + +menu_input_t *menu_input_get_ptr(void); + void menu_input_key_event(bool down, unsigned keycode, uint32_t character, uint16_t key_modifiers); From 4f784a189f4091fea0a90f16f6dd9c539daa9914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 2 Nov 2015 01:44:45 +0700 Subject: [PATCH 3/3] (Menu) Implement taps on tabs --- menu/drivers/glui.c | 111 +++++++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 33 deletions(-) diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index e0300103d1..382977bee4 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -1214,12 +1214,56 @@ static int glui_environ(menu_environ_cb_t type, void *data) return -1; } +static void glui_preswitch_tabs(unsigned action) +{ + glui_handle_t *glui = NULL; + menu_handle_t *menu = menu_driver_get_ptr(); + + if (!menu) + return; + + glui = (glui_handle_t*)menu->userdata; + + if (!glui) + return; + + file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); + size_t stack_size = menu_stack->size; + + if (menu_stack->list[stack_size - 1].label) + free(menu_stack->list[stack_size - 1].label); + menu_stack->list[stack_size - 1].label = NULL; + + switch (glui->categories.selection_ptr) + { + case GLUI_SYSTEM_TAB_MAIN: + menu_stack->list[stack_size - 1].label = + strdup(menu_hash_to_str(MENU_VALUE_MAIN_MENU)); + menu_stack->list[stack_size - 1].type = + MENU_SETTINGS; + break; + case GLUI_SYSTEM_TAB_PLAYLISTS: + menu_stack->list[stack_size - 1].label = + strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB)); + menu_stack->list[stack_size - 1].label = + strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB)); + menu_stack->list[stack_size - 1].type = + MENU_PLAYLISTS_TAB; + break; + case GLUI_SYSTEM_TAB_SETTINGS: + menu_stack->list[stack_size - 1].label = + strdup(menu_hash_to_str(MENU_VALUE_SETTINGS_TAB)); + menu_stack->list[stack_size - 1].type = + MENU_SETTINGS; + break; + } +} + static void glui_list_cache(menu_list_type_t type, unsigned action) { size_t stack_size, list_size; glui_handle_t *glui = NULL; menu_handle_t *menu = menu_driver_get_ptr(); - file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); if (!menu) return; @@ -1260,35 +1304,7 @@ static void glui_list_cache(menu_list_type_t type, unsigned action) break; } - stack_size = menu_stack->size; - - if (menu_stack->list[stack_size - 1].label) - free(menu_stack->list[stack_size - 1].label); - menu_stack->list[stack_size - 1].label = NULL; - - switch (glui->categories.selection_ptr) - { - case GLUI_SYSTEM_TAB_MAIN: - menu_stack->list[stack_size - 1].label = - strdup(menu_hash_to_str(MENU_VALUE_MAIN_MENU)); - menu_stack->list[stack_size - 1].type = - MENU_SETTINGS; - break; - case GLUI_SYSTEM_TAB_PLAYLISTS: - menu_stack->list[stack_size - 1].label = - strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB)); - menu_stack->list[stack_size - 1].label = - strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB)); - menu_stack->list[stack_size - 1].type = - MENU_PLAYLISTS_TAB; - break; - case GLUI_SYSTEM_TAB_SETTINGS: - menu_stack->list[stack_size - 1].label = - strdup(menu_hash_to_str(MENU_VALUE_SETTINGS_TAB)); - menu_stack->list[stack_size - 1].type = - MENU_SETTINGS; - break; - } + glui_preswitch_tabs(action); break; default: break; @@ -1403,9 +1419,18 @@ static int glui_pointer_tap(menu_file_list_cbs_t *cbs, menu_entry_t *entry, unsigned action) { size_t selection, idx; - unsigned header_height; - bool scroll = false; - menu_input_t *menu_input = menu_input_get_ptr(); + unsigned header_height, width, height, i; + bool scroll = false; + menu_input_t *menu_input = menu_input_get_ptr(); + menu_handle_t *menu = menu_driver_get_ptr(); + glui_handle_t *glui = menu ? (glui_handle_t*)menu->userdata : NULL; + file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); + file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); + + if (!glui) + return 0; + + video_driver_get_size(&width, &height); menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); @@ -1415,6 +1440,26 @@ static int glui_pointer_tap(menu_file_list_cbs_t *cbs, menu_entries_pop_stack(&selection, 0); menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); } + else if ((unsigned)menu_input->pointer.start_y > height - glui->tabs_height) + { + for (i = 0; i <= GLUI_SYSTEM_TAB_END; i++) + { + unsigned tab_width = width / (GLUI_SYSTEM_TAB_END + 1); + unsigned start = tab_width * i; + + if ((unsigned)menu_input->pointer.start_x >= start && + (unsigned)menu_input->pointer.start_x < start + tab_width) + { + glui->categories.selection_ptr = i; + + glui_preswitch_tabs(action); + + if (cbs && cbs->action_content_list_switch) + return cbs->action_content_list_switch(selection_buf, menu_stack, + "", "", 0); + } + } + } else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1)) { if (menu_input->pointer.ptr == selection && cbs && cbs->action_select)