I’ve spent hours and hours on this and I can’t figure it out. Please help.
Here’s the scoop, a while back I made an onscreen game controller that I would use to control MAME. It’s a simple little windows form that simulates key presses to other applications.
Recently I decided to update my app to work with latest release of MAME and it just keeps failing. I noticed that Microsoft’s onscreen keyboard is also no longer working as an input device for MAME and I’m guessing it is failing for the same unknown reason… unknown to me that is.
My controller uses the Microsoft SendKeys() function to send key up and down messages. For grins I also tried using SendMessage() but I could see from the MAME source code (window.c) that it wasn’t going to work either as the MAME window is not processing WM_KEYDOWN messages. I received a little glimmer of hope from an article that explained that when you use SendInput() with apps that are using DirectInput, you have to use the scan codes for DirectInput instead of virtual keys. That sounded to me like the silver bullet because I can see that the latest version of MAME is indeed using DirectInput. But alas… after hours of trying different implementations of this I could not get SendInput() to send keyboard input to MAME.
If anyone has any ideas on how to send keys to MAME please let me know. I’m desperate and almost ready to give up on this little endeavor.
|