Hey, Tiger-Heli                                                  
October 13, 2005, 06:30:39 AM
Home Help Search Edit Profile Calendar Logout

BYOAC Forums
Main Forum Software Forums Monitor/Video
Audio/Jukebox/MP3 Project Announcements & HoF Artwork
Consoles Buy/Sell/Trade Arcade Miscellaneous
Everything Else Board Discussion Project Arcade - the book!
  OTHER SITE FORUMS  
Rules| Old Boards | Old Archives | BYOAC People Finder (USA) | Chatroom
+  Build Your Own Arcade Controls Forum
|-+ 
| |-+  Software Forum
| | |-+  Johnny 5 beta 2.0 released!
1 Member and 0 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Reply Notify of replies Send this topic Print
 
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: Johnny 5 beta 2.0 released!
« Reply #19 on: October 11, 2005, 10:38:56 AM »
Reply with quote Modify message Remove message

FYI, you can assign a block of code to multiple keys by listing them like labels:
~Z::
~X::
~LShift::
{
   do something here
}
return
Cool - I was looking for a way to do this.  BTW, my code works, so I think (this will ramble), but say you wanted Johnny5 to launch before MAME and then exit with any key and launch MAME and then come up when you paused MAME and then exit when you pressed any key.

The second part consists of a file - C:\mamebat\default.bat
Code:
      echo off
      c:
      cd\
      cd johnny
      start johnny5.ahk %1
      cd\
      cd mame
      mame %1
      exit
and a johnny5.ahk script:
Code:
#SingleInstance force
#Persistent
; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can remove it.
DetectHiddenWindows, On
ScreenState =0
~P::
{
    if ScreenState > -1
    {papaschtroumpf
    If ScreenState =1
    {
        ScreenState=-1
        BlockInput On
        send, {Escape down}
        send, {Escape up}
        WinActivate,%Title%
        WinRestore,%Title%
        WinActivate,%Title%
        WinWaitActive,%Title%
        sleep 250
        Send,{p down}{p up}
        ScreenState=0
        BlockInput Off
    }
    else
    {
        BlockInput On
        ScreenState=-1
        WinGetActiveTitle, Title
        sleep 100
        J5=Johnny5.exe %1% -ahk 1000
        if 0 >1
            J5=%J5%  -clone %2%
        if 0 >2
            J5=%J5%  -driver %3%
        Run,%J5%, C:\johnny\, max
        ScreenState=1
        BlockInput Off           
    }
    }   
}
return
~Up::
~Down::
~Left::
~Right::
~Control::
~Alt::
~Space::
[color=Red]All your other CP keys[/color]
If ScreenState =1
    {
        ScreenState=-1
        BlockInput On
        WinActivate,%Title%
        WinRestore,%Title%papaschtroumpf
        WinActivate,%Title%
        WinWaitActive,%Title%
        sleep 250
        Send,{p down}{p up}
        ScreenState=0
        BlockInput Off       
    }
return
~Escape::
if ScreenState=1
{
        BlockInput On
        ScreenState=-1
        send, {Escape down}papaschtroumpf
        send, {Escape up}
        WinActivate,%Title%
        WinRestore,%Title%
        WinActivate,%Title%
        WinWaitActive,%Title%
        sleep 250
        Send,{p down}{p up}       
        ScreenState=0
        BlockInput Off       
}
else
{
    ExitApp
}
return
This launches the AHK Script and Johnny5 launches when MAME is paused and exits back to MAME when any CP key is pressed.

Now you write a start.ahk Script as follows (in the c:\Johnny directory):
Code:
#SingleInstance force
#Persistent
; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can remove it.
DetectHiddenWindows, On
ScreenState =0
~Up::
~Down::
~Left::
~Right::
~Control::
~Alt::
~Space::
[color=Red]All your other CP keys[/color]
{
send, {Escape down}
send, {Escape up}papaschtroumpf
M1=default.bat %1%
Run,%M1%, C:\mamebat
ExitApp
}
return
This simply exits Johnny5 when any CP key is pressed and launches the batch file above which launches MAME. . .

Then you write a batch file named C:\mamebat\start.bat - as follows:
Code:
      echo off
      c:
      cd\
      cd johnny
      johnny5 %1
      start start.ahk %1
      exit
This simply launches Johnny5 and launches the start script which will close Johnny5 and launch MAME.

I haven't tested it, but it sounds like it might work.
Report to moderator   Logged

Pages: [1] Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Build Your Own Arcade Controls Forum | Powered by SMF 1.0.5.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
Page created in 0.211 seconds with 23 queries.