mirror of
https://codeberg.org/nsxiv/nsxiv
synced 2024-11-03 23:15:46 +00:00
Simplified keysym lookup
This commit is contained in:
parent
fb6411ab5c
commit
22db1ed361
4
events.c
4
events.c
@ -45,13 +45,11 @@ void event_loop(app_t *app) {
|
|||||||
|
|
||||||
void on_keypress(app_t *app, XEvent *ev) {
|
void on_keypress(app_t *app, XEvent *ev) {
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
XKeyEvent *kev;
|
|
||||||
|
|
||||||
if (!app || !ev)
|
if (!app || !ev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
kev = &ev->xkey;
|
keysym = XLookupKeysym(&ev->xkey, 0);
|
||||||
keysym = XKeycodeToKeysym(app->win.env.dpy, (KeyCode) kev->keycode, 0);
|
|
||||||
|
|
||||||
switch (keysym) {
|
switch (keysym) {
|
||||||
case XK_Escape:
|
case XK_Escape:
|
||||||
|
Loading…
Reference in New Issue
Block a user