make Home and End keys navigate to top/bottom of the active menu
Dana Jansens danakj@orodu.net
5 files changed,
50 insertions(+),
0 deletions(-)
M
openbox/event.c
→
openbox/event.c
@@ -1729,6 +1729,16 @@ else if (ob_keycode_match(keycode, OB_KEY_DOWN)) {
menu_frame_select_next(frame); ret = TRUE; } + + else if (ob_keycode_match(keycode, OB_KEY_HOME)) { + menu_frame_select_first(frame); + ret = TRUE; + } + + else if (ob_keycode_match(keycode, OB_KEY_END)) { + menu_frame_select_last(frame); + ret = TRUE; + } } /* Use KeyRelease events for running things so that the key release doesn't
M
openbox/misc.h
→
openbox/misc.h
@@ -53,6 +53,8 @@ OB_KEY_UP,
OB_KEY_DOWN, OB_KEY_TAB, OB_KEY_SPACE, + OB_KEY_HOME, + OB_KEY_END, OB_NUM_KEYS } ObKey;
M
openbox/openbox.c
→
openbox/openbox.c
@@ -239,6 +239,8 @@ keys[OB_KEY_UP] = modkeys_sym_to_code(XK_Up);
keys[OB_KEY_DOWN] = modkeys_sym_to_code(XK_Down); keys[OB_KEY_TAB] = modkeys_sym_to_code(XK_Tab); keys[OB_KEY_SPACE] = modkeys_sym_to_code(XK_space); + keys[OB_KEY_HOME] = modkeys_sym_to_code(XK_Home); + keys[OB_KEY_END] = modkeys_sym_to_code(XK_End); { ObParseInst *i;@@ -427,6 +429,8 @@ g_free(keys[OB_KEY_UP]);
g_free(keys[OB_KEY_DOWN]); g_free(keys[OB_KEY_TAB]); g_free(keys[OB_KEY_SPACE]); + g_free(keys[OB_KEY_HOME]); + g_free(keys[OB_KEY_END]); modkeys_shutdown(reconfigure); } while (reconfigure);