mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-25 16:02:33 +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:
committed by
Carlos R. Mafra
parent
8f724f65aa
commit
8d7c725b7b
@@ -324,6 +324,7 @@ typedef struct WPreferences {
|
||||
char opaque_move_resize_keyboard; /* update window position during move,resize with keyboard */
|
||||
char wrap_menus; /* wrap menus at edge of screen */
|
||||
char scrollable_menus; /* let them be scrolled */
|
||||
char vi_key_menus; /* use h/j/k/l to select */
|
||||
char align_menus; /* align menu with their parents */
|
||||
char use_saveunders; /* turn on SaveUnders for menus, icons etc. */
|
||||
char no_window_over_dock;
|
||||
|
||||
@@ -391,6 +391,8 @@ WDefaultEntry optionList[] = {
|
||||
&wPreferences.dblclick_time, getInt, setDoubleClick, NULL, NULL},
|
||||
{"AlignSubmenus", "NO", NULL,
|
||||
&wPreferences.align_menus, getBool, NULL, NULL, NULL},
|
||||
{"ViKeyMenus", "NO", NULL,
|
||||
&wPreferences.vi_key_menus, getBool, NULL, NULL, NULL},
|
||||
{"OpenTransientOnOwnerWorkspace", "NO", NULL,
|
||||
&wPreferences.open_transients_with_parent, getBool, NULL, NULL, NULL},
|
||||
{"WindowPlacement", "auto", sePlacements,
|
||||
|
||||
32
src/menu.c
32
src/menu.c
@@ -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
|
||||
|
||||
@@ -348,9 +348,6 @@
|
||||
|
||||
#define KEY_CONTROL_WINDOW_WEIGHT 1
|
||||
|
||||
/* if your keyboard don't have arrow keys */
|
||||
#undef ARROWLESS_KBD
|
||||
|
||||
/* don't put titles in miniwindows */
|
||||
#undef NO_MINIWINDOW_TITLES
|
||||
|
||||
|
||||
Reference in New Issue
Block a user