summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-04-16 21:58:47 +0000
committerSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-04-16 21:58:47 +0000
commit32a5e70e9134f933756a96e547dcdd718b8d5f1e (patch)
tree0ba88391433d9157f96eb484d6de5975ff097181 /gui
parent733612551879e081161604a6e10b7e5fdfe0f89e (diff)
downloadpcsxr-32a5e70e9134f933756a96e547dcdd718b8d5f1e.tar.gz
GTK: dfinput added emulator key (hotkey) mapping to keyboard or controller. Existing hotkeys are hard coded like F1 for savestate, but now it can have an alias hotkey on keyboard s button for example. These can be configured from dfinput dialog. Also added support for fastforward key (tilde / section key). Currently only dfxvideo supports it by full extent. Hopefully someone can merge these changes to Windows build.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@84102 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui')
-rwxr-xr-xgui/Plugin.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gui/Plugin.c b/gui/Plugin.c
index e7e8c2da..0c7901f7 100755
--- a/gui/Plugin.c
+++ b/gui/Plugin.c
@@ -102,7 +102,9 @@ void KeyStateLoad(int i) {
if (Config.Cpu == CPU_DYNAREC) psxCpu->Execute();
}
-static short modctrl = 0, modalt = 0;
+// todo: make toggle config param
+static short modctrl = 0, modalt = 0, toggle = 0, pressed = 0;
+int lastpressed = 0;
/* Handle keyboard keystrokes */
void PADhandleKey(int key) {
@@ -111,11 +113,12 @@ void PADhandleKey(int key) {
short rel = 0; //released key flag
- if (key == 0)
+ if (key == 0 || key == lastpressed)
return;
if ((key >> 30) & 1) //specific to dfinput (padJoy)
rel = 1;
+ //printf("Key %x\n", key);
if (rel) {
switch (key & ~0x40000000) {
@@ -127,10 +130,16 @@ void PADhandleKey(int key) {
case XK_Control_R:
modctrl=0;
break;
+ case XK_section:
+ if (!toggle && pressed) GPU_keypressed( XK_section );
+ pressed = 0;
+ break;
}
+ lastpressed = 0;
return;
}
+ lastpressed = key;
switch (key) {
case XK_Alt_L:
case XK_Alt_R:
@@ -233,6 +242,11 @@ void PADhandleKey(int key) {
case XK_F4:
gpuShowPic();
break;
+ case XK_section:
+ if (pressed) break;
+ GPU_keypressed( XK_section );
+ pressed = 1;
+ break;
case XK_F5:
Config.SioIrq ^= 0x1;
if (Config.SioIrq)