notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drc: fix $ra evicting on JAL
[pcsx_rearmed.git]
/
frontend
/
xkb.c
diff --git
a/frontend/xkb.c
b/frontend/xkb.c
index
874531c
..
88dbc56
100644
(file)
--- a/
frontend/xkb.c
+++ b/
frontend/xkb.c
@@
-44,6
+44,11
@@
static const struct {
{ XK_t, DKEY_R2 },
{ XK_c, DKEY_SELECT },
{ XK_v, DKEY_START },
{ XK_t, DKEY_R2 },
{ XK_c, DKEY_SELECT },
{ XK_v, DKEY_START },
+
+ { XK_F6, 32 + SACTION_SAVE_STATE },
+ { XK_F7, 32 + SACTION_PREV_SSLOT },
+ { XK_F8, 32 + SACTION_NEXT_SSLOT },
+ { XK_F9, 32 + SACTION_LOAD_STATE },
};
static Atom wmprotocols, wmdelwindow;
};
static Atom wmprotocols, wmdelwindow;
@@
-68,22
+73,23
@@
static void DestroyKeyboard(void) {
XkbSetDetectableAutoRepeat(disp, 0, NULL);
}
XkbSetDetectableAutoRepeat(disp, 0, NULL);
}
-
void x11_update_keys(void
) {
+
int x11_update_keys(unsigned int *action
) {
uint8_t i;
XEvent evt;
XClientMessageEvent *xce;
uint16_t Key;
uint8_t i;
XEvent evt;
XClientMessageEvent *xce;
uint16_t Key;
+ static int keystate_x11;
int psxkey, leave = 0;
Display *disp = (Display *)gpuDisp;
int psxkey, leave = 0;
Display *disp = (Display *)gpuDisp;
- if (initialized < 2000) {
+ if (!disp)
+ return 0;
+
+ if (!initialized) {
initialized++;
InitKeyboard();
}
initialized++;
InitKeyboard();
}
- if (!disp)
- return;
-
while (XPending(disp)) {
XNextEvent(disp, &evt);
switch (evt.type) {
while (XPending(disp)) {
XNextEvent(disp, &evt);
switch (evt.type) {
@@
-99,14
+105,18
@@
void x11_update_keys(void) {
}
}
}
}
- if (
psxkey >= 0
) {
+ if (
0 <= psxkey && psxkey < 32
) {
if (evt.type == KeyPress)
if (evt.type == KeyPress)
- keystate |= 1 << psxkey;
+ keystate
_x11
|= 1 << psxkey;
else
else
- keystate &= ~(1 << psxkey);
+ keystate_x11 &= ~(1 << psxkey);
+ }
+ if (evt.type == KeyPress) {
+ if (psxkey > 32)
+ *action = psxkey - 32;
+ if (Key == XK_Escape)
+ leave = 1;
}
}
- if (evt.type == KeyPress && Key == XK_Escape)
- leave = 1;
break;
case ClientMessage:
break;
case ClientMessage:
@@
-121,4
+131,6
@@
void x11_update_keys(void) {
DestroyKeyboard();
exit(1);
}
DestroyKeyboard();
exit(1);
}
+
+ return keystate_x11;
}
}