aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2012-01-01 20:32:40 +0100
committerConnor Lane Smith <cls@lubutu.com>2012-01-01 20:32:40 +0100
commitb95fb20269f55c9fe649d971c53efb8040d3ceea (patch)
tree2c8b6b8607896b6a314a1b269c421de31145323f /dmenu.c
parent6664e4233faa3d6b677a24196e9af4ac5b1920fd (diff)
downloaddmenu-b95fb20269f55c9fe649d971c53efb8040d3ceea.tar.gz
dmenu-b95fb20269f55c9fe649d971c53efb8040d3ceea.tar.bz2
dmenu-b95fb20269f55c9fe649d971c53efb8040d3ceea.zip
add Mod1Mask keybindings
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/dmenu.c b/dmenu.c
index 019fa3e..9fa3e3c 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -243,11 +243,8 @@ keypress(XKeyEvent *ev) {
len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
if(status == XBufferOverflow)
return;
- if(ev->state & ControlMask) {
- KeySym lower, upper;
-
- XConvertCase(ksym, &lower, &upper);
- switch(lower) {
+ if(ev->state & ControlMask)
+ switch(ksym) {
case XK_a: ksym = XK_Home; break;
case XK_b: ksym = XK_Left; break;
case XK_c: ksym = XK_Escape; break;
@@ -281,7 +278,17 @@ keypress(XKeyEvent *ev) {
default:
return;
}
- }
+ else if(ev->state & Mod1Mask)
+ switch(ksym) {
+ case XK_g: ksym = XK_Home; break;
+ case XK_G: ksym = XK_End; break;
+ case XK_h: ksym = XK_Prior; break;
+ case XK_j: ksym = XK_Up; break;
+ case XK_k: ksym = XK_Down; break;
+ case XK_l: ksym = XK_Next; break;
+ default:
+ return;
+ }
switch(ksym) {
default:
if(!iscntrl(*buf))