From 32a5e70e9134f933756a96e547dcdd718b8d5f1e Mon Sep 17 00:00:00 2001 From: "SND\\ckain_cp" Date: Tue, 16 Apr 2013 21:58:47 +0000 Subject: 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 --- gui/Plugin.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'gui/Plugin.c') 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) -- cgit v1.2.3