KeyPress Actions not Working in MAME

If you have a question or need help, this is the place to be.
Post Reply
Dracrius
Posts: 5
Joined: Tue Oct 10, 2017 5:02 pm

KeyPress Actions not Working in MAME

Post by Dracrius » Wed Aug 14, 2019 3:56 pm

I need help figuring out how Eventghost sends keypresses as I'm more then a little lost. I had a script written to press down a key ("5" coin 1) wait release said key, wait and then press another key ("1" Player 1 Start) followed by a wait and a release. This script worked perfectly on a MAMEUI Deluxe 0.156 build but does not work on a 0.166 with Direct Input or my target build GroovyMAME 0.212. One user says it may be due to EventGhost using DirectInput 7 rather then DirectInput 8 which the most recent MAME uses.

Dracrius
Posts: 5
Joined: Tue Oct 10, 2017 5:02 pm

Re: KeyPress Actions not Working in MAME

Post by Dracrius » Wed Aug 14, 2019 4:37 pm

I hate to have done it but I tried Autohotkey out and it works so I'm really at a loss to why EventGhost Key strokes arn't being picked up by MAME. Does anyone know the specifics to how EventGhost sends keypresses in its 2 modes ( default and the alternate method check box) If I knew how it was trying to send the key presses it would be much easier to solve. I am leaning towards the thought that even eventghost 0.5 is using an old version of DirectInput

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: KeyPress Actions not Working in MAME

Post by kgschlosser » Wed Aug 14, 2019 4:49 pm

sending keystrokes requires the Find Window Action to be placed before it. It needs to know what window to send the keystrokes to.
If you like the work I have been doing then feel free to Image

Dracrius
Posts: 5
Joined: Tue Oct 10, 2017 5:02 pm

Re: KeyPress Actions not Working in MAME

Post by Dracrius » Wed Aug 14, 2019 5:25 pm

kgschlosser wrote:
Wed Aug 14, 2019 4:49 pm
sending keystrokes requires the Find Window Action to be placed before it. It needs to know what window to send the keystrokes to.
What no it doesn't, I don't know why you would think that. My script always just freely entered keystrokes. For instance if I have my script running in EventGhost and i open Notepad a joystick button when pressed will produce a 5 followed by a 1 every time. I can then switch to firefox, explorer, any text field in any program and it will do the same. Even in a old version of MAME I use to us i can get them to work its only in builds of MAME post 2015 that EventGhost doesnt seem to work with at all. After a lot of searching I'm pretty sure some part of the keystroke emulation is out of date or bugged as I am 99% sure I have narrowed it down to an EventGhost issue but without knowing how EventGhost is actually sending keystrokes I can't know for sure or offer a Fix to the Devs of either project.

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: KeyPress Actions not Working in MAME

Post by kgschlosser » Thu Aug 15, 2019 5:41 am

give this a try...
add a python command action before your Send Keys action.

In the python command action key in

Code: Select all

del eg.lastFoundWindows[:]
click on the OK button...

now give it a shot.
If you like the work I have been doing then feel free to Image

Post Reply