From 34302812fe6a32ef881bae8a2827213aa8b67336 Mon Sep 17 00:00:00 2001 From: Marco Raber Date: Tue, 14 Dec 2021 16:17:26 +0100 Subject: [PATCH] Added vim like keybindings --- xmenu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xmenu.c b/xmenu.c index 9b3a250..8a62e7a 100644 --- a/xmenu.c +++ b/xmenu.c @@ -1345,8 +1345,8 @@ enteritem: break; } - /* esc closes xmenu when current menu is the root menu */ - if (ksym == XK_Escape && currmenu->parent == NULL) + /* esc (or h) closes xmenu when current menu is the root menu */ + if ( (ksym == XK_h || ksym == XK_Escape) && currmenu->parent == NULL) return; /* Shift-Tab = ISO_Left_Tab */ @@ -1372,7 +1372,7 @@ enteritem: break; } /* FALLTHROUGH */ - case XK_Up: + case XK_Up: case XK_k: select = itemcycle(currmenu, ITEMPREV); action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; break; @@ -1383,7 +1383,7 @@ enteritem: break; } /* FALLTHROUGH */ - case XK_Down: + case XK_Down: case XK_j: select = itemcycle(currmenu, ITEMNEXT); action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; break; @@ -1397,13 +1397,13 @@ enteritem: select = item; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; break; - case XK_Return: case XK_Right: + case XK_Return: case XK_Right: case XK_l: if (currmenu->selected) { item = currmenu->selected; goto enteritem; } break; - case XK_Escape: case XK_Left: + case XK_Escape: case XK_Left: case XK_h: if (currmenu->parent) { select = currmenu->parent->selected; currmenu = currmenu->parent;