1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 05:18:06 +01:00

Made ARROWLESS_KBD a preference.

Replace the ARROWLESS_KBD #define with the ViKeyMenus preference.

When ViKeyMenus is TRUE, users can type h/j/k/l to scroll around menus.

Since ARROWLESS_KBD was previously undefined by default, ViKeyMenus is
FALSE by default.
This commit is contained in:
Iain Patterson
2012-02-10 11:02:25 +00:00
committed by Carlos R. Mafra
parent 8f724f65aa
commit 8d7c725b7b
5 changed files with 34 additions and 18 deletions

View File

@@ -892,6 +892,26 @@ static int keyboardMenu(WMenu * menu)
switch (event.type) {
case KeyPress:
ksym = XLookupKeysym(&event.xkey, 0);
if (wPreferences.vi_key_menus) {
switch (ksym) {
case XK_h:
ksym = XK_Left;
break;
case XK_j:
ksym = XK_Down;
break;
case XK_k:
ksym = XK_Up;
break;
case XK_l:
ksym = XK_Right;
break;
}
}
switch (ksym) {
case XK_Escape:
done = 1;
@@ -914,9 +934,6 @@ static int keyboardMenu(WMenu * menu)
break;
case XK_Up:
#ifdef ARROWLESS_KBD
case XK_k:
#endif
#ifdef XK_KP_Up
case XK_KP_Up:
#endif
@@ -928,9 +945,6 @@ static int keyboardMenu(WMenu * menu)
break;
case XK_Down:
#ifdef ARROWLESS_KBD
case XK_j:
#endif
#ifdef XK_KP_Down
case XK_KP_Down:
#endif
@@ -944,9 +958,6 @@ static int keyboardMenu(WMenu * menu)
break;
case XK_Right:
#ifdef ARROWLESS_KBD
case XK_l:
#endif
#ifdef XK_KP_Right
case XK_KP_Right:
#endif
@@ -970,9 +981,6 @@ static int keyboardMenu(WMenu * menu)
break;
case XK_Left:
#ifdef ARROWLESS_KBD
case XK_h:
#endif
#ifdef XK_KP_Left
case XK_KP_Left:
#endif