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 

How to block a keys usage

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





PostPosted: Fri Jan 09, 2009 4:42 pm    Post subject: How to block a keys usage Reply with quote

Hi i play GTA San Andreas on line. Or San Andreas Multiplayer (SAMP).
One server i play on is a role play server.
Built into the game itself, F4 returns you to the character selection screen.
BUT built into the server code there's life insureance- if i die i respawn with everything i had before.
BUT if i have hit my F4 key at anytime before this, i STILL go back to the class selection screen, AND i will loose all my lifes and hard work, starting again.

So i would like to create a hotkey that WILL stop the use of my F4 key, so if i accidently hit it, i won't loose my progress.

I checked the tutorial, but i findin that hard to find anything in.
Back to top
elchapin



Joined: 06 Mar 2007
Posts: 64
Location: Columbus, OH, USA

PostPosted: Fri Jan 09, 2009 4:49 pm    Post subject: Reply with quote

Code:

F4::
return

_________________
My startup is Telesaur - a telecommuting job site.
Back to top
View user's profile Send private message Visit poster's website
Sivvy



Joined: 21 Jul 2008
Posts: 726
Location: Calgary, AB, Canada

PostPosted: Fri Jan 09, 2009 5:01 pm    Post subject: Reply with quote

Code:
#IfWinActive, San Andreas ; Put the actual name of the window here.
F4::
#IfWinActive
Back to top
View user's profile Send private message
elchapin



Joined: 06 Mar 2007
Posts: 64
Location: Columbus, OH, USA

PostPosted: Fri Jan 09, 2009 5:05 pm    Post subject: Reply with quote

@Sivvy - nice call, I was just getting rid of F4 altogether!
_________________
My startup is Telesaur - a telecommuting job site.
Back to top
View user's profile Send private message Visit poster's website
andy9283
Guest





PostPosted: Fri Jan 09, 2009 5:32 pm    Post subject: Reply with quote

Yeah i alt+tab out and the window name of it is GTA:SA:MP.
But with that code in my script i joined game, pressed F4 but it still said "returning to class selection screen after next death".
Crying or Very sad
Back to top
Sivvy



Joined: 21 Jul 2008
Posts: 726
Location: Calgary, AB, Canada

PostPosted: Fri Jan 09, 2009 8:37 pm    Post subject: Reply with quote

Some games actually prevent AHK from modifying keys...

Code:
#IfWinExist, GTA
F4::Return
#IfWinExist

Maybe just give this a try.
Back to top
View user's profile Send private message
Andy9283
Guest





PostPosted: Sat Jan 10, 2009 1:12 am    Post subject: Reply with quote

Strange, it doesn't work if i just put:
F4::Return

But with the #ifwinexist code Sivvy posted it does work.
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