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: Autohotkey, Mala, and NullDC  (Read 4504 times)

0 Members and 1 Guest are viewing this topic.

Hitek

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 62
  • Last login:September 29, 2013, 07:20:25 pm
Autohotkey, Mala, and NullDC
« on: February 14, 2013, 03:52:35 am »
Howdy yall,
I'm finally getting around to getting NullDC set up on my arcade cab, and I have all setup the way I want it, except getting it to exit properly.
I have autohotkey loaded with a small script, which I assumed would look for the NullDC process, and if it was present when the ESC key was pressed, it would kill the process and return to Mala. This all works perfectly fine, but now, that is the ONLY thing the ESC key works for. It seems that Autohotkey's default action is to take over a key completely.
I don't want autohotkey to take over control of the ESC key, I just want it to listen for it, and if NullDC happens to be up when it's pressed, kill the NullDC process.
Is there any way to accomplish this with autohotkey? If not, How do you guys exit NullDC?

Here's my script for reference:
Code: [Select]
ESC::
Process, Exist, nullDC_Win32_Release-NoTrace.exe
{
If ErrorLevel
{
process, Close, nullDC_Win32_Release-NoTrace.exe
}
}

Thanks,
Keith

Celsius

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:May 10, 2015, 11:40:41 am
    • Rcade project
Re: Autohotkey, Mala, and NullDC
« Reply #1 on: February 14, 2013, 06:36:26 am »
you should probably use the ifwinactive command, so the exit function is only used when nulldc is open
http://www.autohotkey.com/docs/commands/_IfWinActive.htm

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: Autohotkey, Mala, and NullDC
« Reply #2 on: February 14, 2013, 09:12:09 am »
Haven't tested this, but off the top of my head-

Pre Command in Mala:
Code: [Select]
cmd /c start "" "C:\nulldc.ahk"(specify full path to your autohotkey script)

AutoHotKey script:

Code: [Select]
ESC::
Process, Close, nullDC_Win32_Release-NoTrace.exe

ExitApp
Return

The script should start when Mala launches the NullDC game and terminate when you press ESC.

Hitek

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 62
  • Last login:September 29, 2013, 07:20:25 pm
Re: Autohotkey, Mala, and NullDC
« Reply #3 on: February 14, 2013, 05:16:04 pm »
you should probably use the ifwinactive command, so the exit function is only used when nulldc is open
http://www.autohotkey.com/docs/commands/_IfWinActive.htm
That's what the "Process, Exists" does, it only executes the exit function if NullDC is running, and that works, the problem is that while it's listening for the ESC key, no other app can use the ESC key, including Mala.

I believe Badmouth has the right Idea though, instead of having ahk running all the time, i just need to start and stop it with NullDC. I'll try that this evening and see how it works out.

Thanks yall,
Keith

Hitek

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 62
  • Last login:September 29, 2013, 07:20:25 pm
Re: Autohotkey, Mala, and NullDC
« Reply #4 on: February 14, 2013, 10:37:59 pm »
Yep, BadMouth's suggestion works like a charm, thanks!

Keith

Celsius

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:May 10, 2015, 11:40:41 am
    • Rcade project
Re: Autohotkey, Mala, and NullDC
« Reply #5 on: February 15, 2013, 02:43:18 am »
got 1 ahk script for everything running in the background and in 1 game esc just works as an esc key and in the other as quit/close

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: Autohotkey, Mala, and NullDC
« Reply #6 on: February 15, 2013, 09:43:56 am »
Yep, BadMouth's suggestion works like a charm, thanks!

Keith

Credit for the pre-command goes to DrVenture & Wade007.
I lifted it from a thread where they worked it out  :)
« Last Edit: February 15, 2013, 10:09:59 am by BadMouth »