From 3dcdbe2a57a19bf727113eca6aa35b1c7cb0ef28 Mon Sep 17 00:00:00 2001 From: "arg@mig29" Date: Thu, 14 Dec 2006 14:40:58 +0100 Subject: added vi-like key-bindings for keyboards without cursor keys (they are undocumented features) --- config.mk | 2 +- main.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 7beebff..00fe5a9 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # dmenu version -VERSION = 1.7.1 +VERSION = 1.8 # Customize below to fit your system diff --git a/main.c b/main.c index c10dfaa..06b2ca9 100644 --- a/main.c +++ b/main.c @@ -178,6 +178,29 @@ kpress(XKeyEvent * e) { break; } } + if(e->state & Mod1Mask) { + switch(ksym) { + default: return; + case XK_h: + ksym = XK_Left; + break; + case XK_l: + ksym = XK_Right; + break; + case XK_j: + ksym = XK_Next; + break; + case XK_l: + ksym = XK_Prior; + break; + case XK_g: + ksym = XK_Home; + break; + case XK_G: + ksym = XK_End; + break; + } + } switch(ksym) { default: if(num && !iscntrl((int) buf[0])) { -- cgit v1.2.3-54-g00ecf