Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

I know this has been discussed in the past, but is there an easy way to remap multiple keys to a single command? I need to remap up + down (actually gamepad up + gamepad down) to Escape and left + right to P. I tried AHK, but when I use "Up & Down::P", it works, but it disables the up key. I kinda need it for playing games though :D

I wrote something a while back that could do this and I could use it again, but it's a bit complicated and seems overkill. I wanted to know if anyone knew of a SIMPLE way to do it? Oh yeah, I tried XPadder to do this and was very unsatisfied with the results. It wasn't very reliable, timing, etc.

Thanks guys!

BTW, here's my code from before...

#InstallKeybdHook
#SingleInstance force



#Persistent
SetTimer, WatchQuitCombo, 250
return



WatchQuitCombo:
if GetKeyState("Joy1") AND GetKeyState("Joy2")
{
SetTimer, ComboQuitDown, 100
SetTimer, WatchQuitCombo, Off
}
return

ComboQuitDown:
if GetKeyState("Joy1") AND GetKeyState("Joy2")
{
QuitWaitTime:=QuitWaitTime + 100
if QuitWaitTime >=2000
{
IfWinActive MAME
{
Send {Blind}{Escape}
}
;IfWinActive <Another Emulator>
;{
; Send {Blind}{Escape}
;}
QuitWaitTime:=0
SetTimer, WatchQuitCombo, 250
}
}
Else
{
QuitWaitTime:=0
SetTimer, WatchQuitCombo, 250
}
return

Posted

I was just thinking and realized that I can do the quit without any extra code. For MAME, I can just use the combination exit built into MAME. For the other emulators, I can use the advanced settings to have a combination exit.

As for Pause, I can have the combined keys in MAME again, but I don't know what to do for the emulators. Any thoughts? For now, if nothing else, I guess I can forgo pause in emulators. Or, maybe I could rewire the coin buttons to be combos and quit and pause to be real buttons. MAME is the only one that needs a coin button, so maybe that would be easier all around.

Posted

Well I'm no AHK expert but what you got posted seems rather clean to me...well you could remove the commented lines...but that amounts to nothing.

Its as bare bones as it gets...how you have it.

Posted

Yeah, I wrote that one for my driving cab that only has 2 buttons plus 2 coin door buttons (which stick). That was before Tom released the GameLauncher option which solved a lot of problems for me since it only needs 2 buttons (well, to be fair, you can run GameEx with 2 normally too). Only problem is that I was experiencing weird unexplainable crashes, so I have that cab on the back burner for now.

In any case, I put a wait in there to require the buttons to be held for a wait period prior to sending escape. I may reduce that or remove it altogether if I end up using this script. I wasn't sure if there was a way to do this directly in any other language like AI or something, so I asked. ^_^

Posted

Well, I know this wont be much help right now, and im not sure exactly what problems you had with xpadder. But I know when you map keys it does not disable the original gampad signals. It just ads the keyboard presses over it which could be why timing and such seemed messed up.

If you can wait a few weeks. I think he said it will probably be out next month sometime. He is realeasing the keyboard driver so windows will think xpadder has its own keyboard attached instead of virtual key presses or whatever it does now.

Just a though. :D

Posted

Interesting!

Hey, I had another question that's related to this, but on the hardware side. I know I need a diode between the signal and switch to keep the signal lines from actually touching, but I can't find any docs that say what type of diode is needed. I'll be using something from Radio Shack or out of my stockpile. Any recommendations? Does it matter that much? I have one that says fast switching, and the other says something about high current. I don't have the two in front of me, but I'm thinking that signal wires from the GP-Wiz shouldn't carry a significant current (that would be bad) and they need to respond quickly, so I'm leaning towards the faster one. Any EE's out there that can offer any advice?

Posted
Interesting!

Hey, I had another question that's related to this, but on the hardware side. I know I need a diode between the signal and switch to keep the signal lines from actually touching, but I can't find any docs that say what type of diode is needed. I'll be using something from Radio Shack or out of my stockpile. Any recommendations? Does it matter that much? I have one that says fast switching, and the other says something about high current. I don't have the two in front of me, but I'm thinking that signal wires from the GP-Wiz shouldn't carry a significant current (that would be bad) and they need to respond quickly, so I'm leaning towards the faster one. Any EE's out there that can offer any advice?

I'm not an expert but your reasoning sounds plausible to me.

Jay T

Posted

That's what I was leaning towards. I found the package and they are 4148's, so I'm gonna give them a try. It would cost more in gas to go buy new ones than these cost, so I figure they are worth a try anyway.

  • 3 weeks later...
Posted

Just realized I never finished off this thread. I used the 4148's and they worked great!

Now my only problem is that when I set up an advanced configuration file, pressing two keys doesn't exit. I've never used a multi-key exit before, so perhaps I have it set up wrong. Anyone want to take a look and see if I missed anything?

Generic_Emulator.zip

Posted
Just realized I never finished off this thread. I used the 4148's and they worked great!

Now my only problem is that when I set up an advanced configuration file, pressing two keys doesn't exit. I've never used a multi-key exit before, so perhaps I have it set up wrong. Anyone want to take a look and see if I missed anything?

You have up set in that as well, is that right?

As it is it should exit when button 8, 9 and up are pressed on gamepad. Theres no keys setup to exit in that config.

Let me know exactly what you want it to do.

Guest
This topic is now closed to further replies.
×
×
  • Create New...