Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Got Supermodel working with dual guns & rawinput - now AutoHotKey doesn't work  (Read 3964 times)

0 Members and 1 Guest are viewing this topic.

TheElectricMonk

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 40
  • Last login:May 06, 2022, 04:17:57 pm
  • I want to build my own arcade controls!
I'm currently setting up a guns-only game cabinet, and I'm looking into adding Ocean Hunter on the Supermodel emulator.

To enable dual guns, Supermodel must be run with the -input-system=rawinput command line. So far, so good.
I also needed to set the controls in the .ini file to read the guns as mouse3 and mouse4, for whatever reason, but that works, too.

My problem:
All my other emulators have the Q key configured to exit the emulator and F8 to restore a saved state.
Supermodel uses Esc and F7 respectively, and this is hardcoded and can't be changed via the .ini file.
I've written a script in AutoHotkey that changes the relevant keys, and it works fine in Star Wars Trilogy Arcade, since that doesn't use the rawinput option.
However, using rawinput blocks AutoHotKey's inputs. I've played around with SendPlay and SendEvent instead of SendInput, to no avail. If I disable rawinput, the second gun doesn't work.

Are there any AHK pros out there that can tell me how (or even if) I can get AutoHotKey to get past the rawinput barrier?

The alternative would be to go and remap MAME, snes9x, nestopia, Daphne, Dolphin and Phoenix to use Esc and F7, and I'd rather avoid that hassle if I can.

Any help is much appreciated.

nexusmtz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 489
  • Last login:June 01, 2022, 03:14:22 am
If there were any way for AHK to work with raw input, someone would have discovered it while trying to get AHK working with MAME's (default) rawinput configuration. Fortunately, MAME now lets you specify different providers for lightgun and keyboard. It sounds like you need a similar option in Supermodel, although an input config option would suffice and would probably be easier to implement. Then again, changing two hard-coded keys should only be a couple lines in the source, and that would handle your particular case. (It's still open source, right?)

TheElectricMonk

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 40
  • Last login:May 06, 2022, 04:17:57 pm
  • I want to build my own arcade controls!
If there were any way for AHK to work with raw input, someone would have discovered it while trying to get AHK working with MAME's (default) rawinput configuration.

(slaps forehead) You're right of course. Silly of me. Sometimes I'm sitting on my brain...

Then again, changing two hard-coded keys should only be a couple lines in the source, and that would handle your particular case. (It's still open source, right?)

Not sure, but at any rate it looks like the Supermodel forums will be my next port of call. I've configured all my other emulators to use ESC and F7 (it was actually much less of a hassle than I feared), and now all that's bothering me is Supermodel's native use of ALT+P for pause. Maybe someone over at the Supermodel forums will be so kind as to compile me a build with that key changed to P.  :)

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Not sure, but at any rate it looks like the Supermodel forums will be my next port of call. I've configured all my other emulators to use ESC and F7 (it was actually much less of a hassle than I feared), and now all that's bothering me is Supermodel's native use of ALT+P for pause. Maybe someone over at the Supermodel forums will be so kind as to compile me a build with that key changed to P.  :)

I am having this exact same issue. I cant remap the pause key to my gamepad. I have successfully hexedited the supermodel.exe file and can change the pause key to any keyboard input I chose however I cant change it to a gamepad input.

Did you find a solution?

Thanks
« Last Edit: September 24, 2018, 07:58:21 pm by vandale »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Instead of trying to inject a raw input key (which is possible although I don't know how using AutoHotkey) how about sending a message to the emulator window such as WM_QUIT or WM_CLOSE to close it?


lisowskikevin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 326
  • Last login:April 30, 2021, 10:42:04 am
  • If you take shortcuts, you get cut short.
I'm currently setting up a guns-only game cabinet, and I'm looking into adding Ocean Hunter on the Supermodel emulator.

To enable dual guns, Supermodel must be run with the -input-system=rawinput command line. So far, so good.
I also needed to set the controls in the .ini file to read the guns as mouse3 and mouse4, for whatever reason, but that works, too.

My problem:
All my other emulators have the Q key configured to exit the emulator and F8 to restore a saved state.
Supermodel uses Esc and F7 respectively, and this is hardcoded and can't be changed via the .ini file.
I've written a script in AutoHotkey that changes the relevant keys, and it works fine in Star Wars Trilogy Arcade, since that doesn't use the rawinput option.
However, using rawinput blocks AutoHotKey's inputs. I've played around with SendPlay and SendEvent instead of SendInput, to no avail. If I disable rawinput, the second gun doesn't work.

Are there any AHK pros out there that can tell me how (or even if) I can get AutoHotKey to get past the rawinput barrier?

The alternative would be to go and remap MAME, snes9x, nestopia, Daphne, Dolphin and Phoenix to use Esc and F7, and I'd rather avoid that hassle if I can.

Any help is much appreciated.

Could I trouble to ask you where you typed that command line to get both guns working? I’m running it through hyperspin and I don’t know where to input the command line for raw input.

Any help would be greatly appreciated!