AutoHotkey Community

It is currently May 27th, 2012, 1:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: August 13th, 2008, 5:59 pm 
Offline

Joined: August 9th, 2008, 3:41 pm
Posts: 28
The case is like this:
I am using photoshop and intended to assign single key to an action
for example: 8:send {m}

however, when i do this, what i type out will run, mother--->8other

Is there any function that can stop the script when the user is typing?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2008, 6:05 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Code:
#IfWinExist, Photoshop
m::8


Should only allow the "m" hotkey to work while in Photoshop, and not in any other window.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 7:33 am 
Thanks Sivvy, i have tried it out, it has solved the problem when i am typing in the other window, but..... What if i want to type text in photoshop?

I have tried to use Windowspy to see if there any chance to find ahk_class of text tool in photoshop, but it shows the ahk_class of photoshop....

:shock: how!!?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 1:45 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Look up "Hotkey" in the helpfile. You can use:

Code:
Hotkey, 8, on
Hotkey, 8, off


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 2:44 pm 
Offline

Joined: November 5th, 2007, 7:25 pm
Posts: 454
Location: canada
As others have mentionned you can disable your hotkeys and enable them later

Example of something I use

Code:
;Autoexec section
menu, Tray, icon, c:\myU.ico

; make sure scrolllock is "off"
 if (GetKeyState("scrolllock" , "T"]))
 {
   ;turn if off if it isnt
   SetScrollLockState , Off
 }
   hotkey , F4, Off
   hotkey , F1, Off
   hotkey , lwin, Off
   hotkey , Pause, Off
   hotkey , RButton, Off
   hotkey , ^up, Off
   hotkey , ^down, Off
   hotkey , ^enter, Off
;...
;...
return

~scrolllock::
   GetKeystate , scrollstate, scrolllock, T
   hotkey , F4, toggle
   hotkey , F1, toggle
   hotkey , lwin, toggle
   hotkey , Pause, toggle
   hotkey , RButton, toggle
   hotkey , ^up, toggle
   hotkey , ^down, toggle
   hotkey , ^enter, toggle
;...
;...
   menu , Tray, icon, c:\my%scrollState%.ico
return


When I hit scrolllock it activates all my hotkeys and changes my icon in my taskbar

I have 2 icons one green for "active" and one yellow for disabled.
call your icons myU.ico and myD.ico
U for Up and D for down...
Anyhow you can change it to your likings.. thats what I use anyhow.

_________________
-=Raz=-


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 4:30 pm 
Offline

Joined: January 6th, 2008, 8:09 pm
Posts: 39
Location: Gdi+ v1.1
Jiashern1 wrote:
I have tried to use Windowspy to see if there any chance to find ahk_class of text tool in photoshop, but it shows the ahk_class of photoshop....

:shock: how!!?


Try with "Winspector Spy".


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2009, 8:48 am 
I'm a newbie trying to learn AHK.
I have tried the codes here but they're not working.

Here's what I'm trying to do.

LButton::F1

Then I wanted to press X to either disable it temporarily so I could use the mouse again, or just to shut off AHK altogether
Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2009, 8:58 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Read up on http://www.autohotkey.com/docs/commands/Suspend.htm so adding X::Suspend to your script above should be enough, now you can press X to toggle it. But of course X is a regular letter to type so I would suggest a keycombo as described in the suspend doc linked above.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2009, 9:49 am 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
Choose a different button.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, oldbrother and 19 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