Refactoring

This commit is contained in:
Bert Münnich 2018-01-09 19:37:56 +01:00
parent 6d261b4e7a
commit 8017b75de4
2 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,4 @@
VERSION = git-20171207 VERSION = git-20180109
srcdir = . srcdir = .
VPATH = $(srcdir) VPATH = $(srcdir)

16
main.c
View File

@ -566,22 +566,20 @@ end:
void on_keypress(XKeyEvent *kev) void on_keypress(XKeyEvent *kev)
{ {
int i; int i;
unsigned int sh; unsigned int sh = 0;
KeySym ksym, shksym; KeySym ksym, shksym;
char key; char dummy, key;
bool dirty = false; bool dirty = false;
XLookupString(kev, &key, 1, &ksym, NULL);
if (kev->state & ShiftMask) { if (kev->state & ShiftMask) {
kev->state &= ~ShiftMask; kev->state &= ~ShiftMask;
XLookupString(kev, &key, 1, &shksym, NULL); XLookupString(kev, &dummy, 1, &shksym, NULL);
kev->state |= ShiftMask; kev->state |= ShiftMask;
XLookupString(kev, &key, 1, &ksym, NULL); if (ksym != shksym)
sh = ksym != shksym ? ShiftMask : 0; sh = ShiftMask;
} else {
XLookupString(kev, &key, 1, &ksym, NULL);
sh = 0;
} }
if (IsModifierKey(ksym)) if (IsModifierKey(ksym))
return; return;
if (ksym == XK_Escape && MODMASK(kev->state) == 0) { if (ksym == XK_Escape && MODMASK(kev->state) == 0) {