Main > Main Forum
Shut Down Windows with Joystick?
<< < (2/3) > >>
DeLuSioNal29:
The Front End Maximus Arcade supports this feature.

Simply map the keys/buttons you want to shut down (#10 in diagram):  How to map keys

Then set a delay so that when you hold down those keys/buttons it will shut down (#3 in diagram):  How to set delays

DeLuSioNaL29
allroy1975:

--- Quote from: Necro on February 13, 2010, 12:10:16 am ---I'm pretty sure you could get something to work using AutoHotKey.

--- End quote ---


--- Quote ---You can define a custom combination of two keys (except joystick buttons) by using " & " between them. In the below example, you would hold down Numpad0 then press the second key to trigger the hotkey:
--- End quote ---
Damn  this is exactly what I wanted to do.


--- Quote from: DeLuSioNal29 on February 15, 2010, 06:29:20 pm ---The Front End Maximus Arcade supports this feature.

--- End quote ---

Do I really need a front end for 1 game?  ;)

I currently have a batch file in the startup folder on this cab that reads:

mame roadblstr
shutdown -s -t 00

so it starts the game, then when you hit escape it shuts down windows.  That'd be great...if I had a way of hitting escape.  I could have used mouse buttons, but at this point....the mouse buttons are wired into the buttons on the steering wheel.  I'm just not gonna redo all that.  it was a pain in the A the first time.

any other ideas?
allroy1975:

--- Quote from: Necro on February 13, 2010, 12:10:16 am ---I'm pretty sure you could get something to work using AutoHotKey.

--- End quote ---

anyone good at this?  Can't figure out why this isn't working:

--- Code: ---~Joy1::
tt=0 ; set time to 0
loop,10000 ; check every 30 ms
{
      GetKeyState, state , Joy1, p 
   if state=U
       Break   
   tt+=30
   sleep 30
}
if tt>5000  ; if key pressed more than 5 secs
{
   Send {Esc}
   sleep 2000
}
Tooltip
return

--- End code ---

Works fine in Windows..but when I'm in MAME, it doesn't get the "esc" keypress.  pretty frustrating.
allroy1975:
well, it's ugly...but...it works.  if the coin button (Joy1) is held down for more than 5 seconds, it kills mame, then my batch file finished running..shutting down windows.

I could of course just change the batch file to not shut down windows and instead set the script to
run, shutdown -s -t 00

but..whatever

--- Code: ---~Numpad1::
tt=0 ; set time to 0
loop,10000 ; check every 30 ms
{
      GetKeyState, state , Numpad1, p 
   if state=U
       Break   
   tt+=30
   sleep 30
}
if tt>5000  ; if key pressed more than 5 secs
{
Run, taskkill /IM mame.exe   
sleep 2000
}
Tooltip
return

--- End code ---
allroy1975:
not sure if anyone here cares really....but....running this script was killing mame and in Road Blasters, it wasn't saving my high scores.  weak.

So I'm documenting (for myself) and sharing in case anyone else wants such a script.....

I changed my AHK to run:

--- Quote ---~Joy1::
tt=0 ; set time to 0
loop,10000 ; check every 10 seconds
{
      GetKeyState, state , Joy1, p 
   if state=U
       Break   
   tt+=30
   sleep 30
}
if tt>5000  ; if key pressed more than 5 secs
{
   IfWinExist, MAME
       WinActivate
         Send {Esc Down}
         sleep 1000
         run, shutdown -s -t 00
}
return
--- End quote ---
Navigation
Message Index
Next page
Previous page

Go to full version