 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jackcondon Guest
|
Posted: Thu Mar 18, 2010 12:17 pm Post subject: A really simple problem im sure |
|
|
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
|
Posted: Thu Mar 18, 2010 12:54 pm Post subject: |
|
|
| 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
|
Posted: Thu Mar 18, 2010 1:02 pm Post subject: |
|
|
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 |
|
 |
Jackcondon Guest
|
Posted: Thu Mar 18, 2010 1:20 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|