commit 214e51b
Devine Lu Linvega
·
2025-01-18 03:57:27 +0000 UTC
parent c0a8ee6
Housekeeping
1 files changed,
+4,
-5
+4,
-5
1@@ -121,6 +121,7 @@ toggle_scale(void)
2 static void
3 emu_event(void)
4 {
5+ char buf[7];
6 XEvent ev;
7 XNextEvent(display, &ev);
8 switch(ev.type) {
9@@ -135,7 +136,6 @@ emu_event(void)
10 break;
11 case KeyPress: {
12 KeySym sym;
13- char buf[7];
14 XLookupString((XKeyPressedEvent *)&ev, buf, 7, &sym, 0);
15 switch(sym) {
16 case XK_F1: toggle_scale(); break;
17@@ -151,7 +151,6 @@ emu_event(void)
18 } break;
19 case KeyRelease: {
20 KeySym sym;
21- char buf[7];
22 XLookupString((XKeyPressedEvent *)&ev, buf, 7, &sym, 0);
23 controller_up(get_button(sym));
24 } break;
25@@ -172,9 +171,9 @@ emu_event(void)
26 case MotionNotify: {
27 XMotionEvent *e = (XMotionEvent *)&ev;
28 int x = (e->x - PAD) / uxn_screen.scale, y = (e->y - PAD) / uxn_screen.scale;
29- clamp(x, 0, uxn_screen.width - 1)
30- clamp(y, 0, uxn_screen.height - 1)
31- mouse_pos(x, y);
32+ clamp(x, 0, uxn_screen.width - 1);
33+ clamp(y, 0, uxn_screen.height - 1);
34+ mouse_pos(x, y);
35 } break;
36 }
37 }