AutoHotkey Community

It is currently May 27th, 2012, 2:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: March 18th, 2010, 1:17 pm 
OK, i feel almost embarrised to ask this. I have read the documentation and have a perfect example code but still i cant seem to get it to work!

My problem is this, i want to run a game using hyperspin (but i suppose thats not important), the problem is i have made a neat controler console but one of the outputs is ALT


THe specific program im using of course, if you hit alt, brngs up the file menu and really ruins the game experience.

So, heres my code, its mixed in with some hyperspin stuff.

else if (systemName = "Sony Playstation" && executable = "psxfin.exe")
{
psxParams = -f
Hotkey, %exitEmulatorKey%, CloseProcess
Run, %Executable% %psxParams% "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel
DetectHiddenWindows, on
#IfWinActive ahk_class pSX
#alt::z

WinWait, ahk_class pSX
hideDesktop()
WinWaitClose, ahk_class pSX

}

The game runs but the alt key does not change.
My theory is that i dont have any understanding of classes and that pSX needs to be changed to something else. (i tryed subing it with the exe name, the title and some other things.)

The other thing i tryed was alt:z
But then when you close the game it wont change back so i really want to make it window specific.



Its my first post, and my first ahk script iv edited. (total newbie)
Thanks!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 1:54 pm 
You prolly want to put hotkey definitions in the auto-executesection of the script.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:02 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
I can see two problems,
1) you didn't post the script, you posted a "torn-off piece" of it.
A runnable script does not start with "else if ..."

2) #Ifwinactive ...
does not work in the middle of an IF statement

3) you need to used Window Spy (in th Ahk folder on your computer)
to get the class of the program window.

4) you didn't post using [code][/code] tags


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:20 pm 
Thanks for the responce! will use windowspy to get the class and see where else i can slip in the code.

Sorry for my improper post.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn and 28 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group