aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2018-01-09 19:37:56 +0100
committerBert Münnich <ber.t@posteo.de>2018-01-09 19:37:56 +0100
commit8017b75de4c2a77245f5ae9d635cc026c00783a7 (patch)
treee52bce78f987825a00c9cb5f3b931e21e0db6d70
parent6d261b4e7af3109169edd9ceaeeb5751a01a9596 (diff)
Refactoring
-rw-r--r--Makefile2
-rw-r--r--main.c16
2 files changed, 8 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index bd8f0ea..3df162f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = git-20171207
+VERSION = git-20180109
srcdir = .
VPATH = $(srcdir)
diff --git a/main.c b/main.c
index 41ae8b2..04e155a 100644
--- a/main.c
+++ b/main.c
@@ -566,22 +566,20 @@ end:
void on_keypress(XKeyEvent *kev)
{
int i;
- unsigned int sh;
+ unsigned int sh = 0;
KeySym ksym, shksym;
- char key;
+ char dummy, key;
bool dirty = false;
+ XLookupString(kev, &key, 1, &ksym, NULL);
+
if (kev->state & ShiftMask) {
kev->state &= ~ShiftMask;
- XLookupString(kev, &key, 1, &shksym, NULL);
+ XLookupString(kev, &dummy, 1, &shksym, NULL);
kev->state |= ShiftMask;
- XLookupString(kev, &key, 1, &ksym, NULL);
- sh = ksym != shksym ? ShiftMask : 0;
- } else {
- XLookupString(kev, &key, 1, &ksym, NULL);
- sh = 0;
+ if (ksym != shksym)
+ sh = ShiftMask;
}
-
if (IsModifierKey(ksym))
return;
if (ksym == XK_Escape && MODMASK(kev->state) == 0) {