diff options
author | notaz | 2011-06-06 18:46:34 +0300 |
---|---|---|
committer | notaz | 2011-06-06 18:46:34 +0300 |
commit | 4218954fcca1237c29f0ba071a4e62d80542cd7e (patch) | |
tree | a702626a086fb683c72e2805177495bd00fa5885 /frontend | |
parent | de910c6be0c5523bd6c29b527ded4323fb8e85eb (diff) | |
download | pcsx_rearmed-4218954fcca1237c29f0ba071a4e62d80542cd7e.tar.gz pcsx_rearmed-4218954fcca1237c29f0ba071a4e62d80542cd7e.tar.bz2 pcsx_rearmed-4218954fcca1237c29f0ba071a4e62d80542cd7e.zip |
frontend: support some emu actions in x11 build
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/plugin_lib.c | 5 | ||||
-rw-r--r-- | frontend/xkb.c | 17 |
2 files changed, 16 insertions, 6 deletions
diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index c2fa100..ee0e086 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -171,8 +171,9 @@ static void update_input(void) in_keystate = actions[IN_BINDTYPE_PLAYER12]; #ifdef X11 - extern int x11_update_keys(void); - in_keystate |= x11_update_keys(); + extern int x11_update_keys(unsigned int *action); + in_keystate |= x11_update_keys(&emu_act); + emu_set_action(emu_act); #endif } diff --git a/frontend/xkb.c b/frontend/xkb.c index 7d00786..88dbc56 100644 --- 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_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; @@ -68,7 +73,7 @@ static void DestroyKeyboard(void) { XkbSetDetectableAutoRepeat(disp, 0, NULL); } -int x11_update_keys(void) { +int x11_update_keys(unsigned int *action) { uint8_t i; XEvent evt; XClientMessageEvent *xce; @@ -100,14 +105,18 @@ int x11_update_keys(void) { } } - if (psxkey >= 0) { + if (0 <= psxkey && psxkey < 32) { if (evt.type == KeyPress) keystate_x11 |= 1 << psxkey; else keystate_x11 &= ~(1 << psxkey); } - if (evt.type == KeyPress && Key == XK_Escape) - leave = 1; + if (evt.type == KeyPress) { + if (psxkey > 32) + *action = psxkey - 32; + if (Key == XK_Escape) + leave = 1; + } break; case ClientMessage: |