aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
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) {
243 len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status); 243 len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
244 if(status == XBufferOverflow) 244 if(status == XBufferOverflow)
245 return; 245 return;
246 if(ev->state & ControlMask) { 246 if(ev->state & ControlMask)
247 KeySym lower, upper; 247 switch(ksym) {
248
249 XConvertCase(ksym, &lower, &upper);
250 switch(lower) {
251 case XK_a: ksym = XK_Home; break; 248 case XK_a: ksym = XK_Home; break;
252 case XK_b: ksym = XK_Left; break; 249 case XK_b: ksym = XK_Left; break;
253 case XK_c: ksym = XK_Escape; break; 250 case XK_c: ksym = XK_Escape; break;
@@ -281,7 +278,17 @@ keypress(XKeyEvent *ev) {
281 default: 278 default:
282 return; 279 return;
283 } 280 }
284 } 281 else if(ev->state & Mod1Mask)
282 switch(ksym) {
283 case XK_g: ksym = XK_Home; break;
284 case XK_G: ksym = XK_End; break;
285 case XK_h: ksym = XK_Prior; break;
286 case XK_j: ksym = XK_Up; break;
287 case XK_k: ksym = XK_Down; break;
288 case XK_l: ksym = XK_Next; break;
289 default:
290 return;
291 }
285 switch(ksym) { 292 switch(ksym) {
286 default: 293 default:
287 if(!iscntrl(*buf)) 294 if(!iscntrl(*buf))