AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A really simple problem im sure

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jackcondon
Guest





PostPosted: Thu Mar 18, 2010 12:17 pm    Post subject: A really simple problem im sure Reply with quote

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!
Back to top
answer4u
Guest





PostPosted: Thu Mar 18, 2010 12:54 pm    Post subject: Reply with quote

You prolly want to put hotkey definitions in the auto-execute section of the script.
Back to top
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Thu Mar 18, 2010 1:02 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Jackcondon
Guest





PostPosted: Thu Mar 18, 2010 1:20 pm    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group