ui: add more keyboard controls (home/end/pageup/pagedown)

Add support for: up/down/pageup/pagedown/home/end
There behaviour kinda makes sense visually, not logically (ie.
up goes to the left, pageup also, home also).

I didn't add any hint on the ui, just press the keys and test :)
This commit is contained in:
Jean-Philippe Andre 2016-03-18 15:00:29 +09:00
parent f8b38f6c24
commit f7fa84bf93
1 changed files with 7 additions and 1 deletions

View File

@ -275,7 +275,13 @@ _ui_key(void *data EINA_UNUSED, const Eo_Event *event)
if (menu_active)
if (!strcmp(ev->keyname, "Left")) menu_sel++;
if (!strcmp(ev->keyname, "Right")) menu_sel--;
else if (!strcmp(ev->keyname, "Right")) menu_sel--;
else if (!strcmp(ev->keyname, "Up")) menu_sel++;
else if (!strcmp(ev->keyname, "Down")) menu_sel--;
else if (!strcmp(ev->keyname, "Home")) menu_sel = eina_list_count(menu) - 1;
else if (!strcmp(ev->keyname, "End")) menu_sel = 0;
else if (!strcmp(ev->keyname, "Next")) menu_sel -= 10;
else if (!strcmp(ev->keyname, "Prior")) menu_sel += 10;
if (menu_sel < 0) menu_sel = 0;
else if ((unsigned int)menu_sel >= eina_list_count(menu)) menu_sel = eina_list_count(menu) - 1;
menu_anim_sel = menu_sel;