Krolyxon
Commit 8017b75

Branches

Refs →

nsxiv8017b75

Refactoring

Author
Bert Münnich
Date
2018-01-09 19:37 +0100
Parent
6d261b4
Commit
8017b75de4c2a77245f5ae9d635cc026c00783a7

+8 −10

2 files changed

  1. M Makefile +1 −1
  2. M main.c +7 −9
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20171207
1+VERSION = git-20180109
22
33 srcdir = .
44 VPATH = $(srcdir)
M main.c View
@@ -566,22 +566,20 @@ end:
566566 void on_keypress(XKeyEvent *kev)
567567 {
568568 int i;
569− unsigned int sh;
569+ unsigned int sh = 0;
570570 KeySym ksym, shksym;
571− char key;
571+ char dummy, key;
572572 bool dirty = false;
573573
574+ XLookupString(kev, &key, 1, &ksym, NULL);
575+
574576 if (kev->state & ShiftMask) {
575577 kev->state &= ~ShiftMask;
576− XLookupString(kev, &key, 1, &shksym, NULL);
578+ XLookupString(kev, &dummy, 1, &shksym, NULL);
577579 kev->state |= ShiftMask;
578− XLookupString(kev, &key, 1, &ksym, NULL);
579− sh = ksym != shksym ? ShiftMask : 0;
580− } else {
581− XLookupString(kev, &key, 1, &ksym, NULL);
582− sh = 0;
580+ if (ksym != shksym)
581+ sh = ShiftMask;
583582 }
584−
585583 if (IsModifierKey(ksym))
586584 return;
587585 if (ksym == XK_Escape && MODMASK(kev->state) == 0) {