Sign in to follow this  
Followers 0
gda

Hotkeys are not functioning

4 posts in this topic

#1 ·  Posted (edited)

Hi,

first post for me on the forums :)

i've just started using autoit to (try) and make some hotkey to help me in photoshop work. What i planned to do was assign a hotkey to make the cursor to move to a set screen location so workflow is much faster... theoretically..

this is what i have now

HotKeySet("{ESC}","quit")
HotKeySet("{`}","aa")


While 1
MouseMove(31,50,0)
WEnd 


Func aa()
MouseMove(300,130,0)
EndFunc

Func quit()
Exit
EndFunc

the quit function works but the aa function does not

could someone please guide me in the right direction :)

Edited by gda

Share this post


Link to post
Share on other sites



Hi,

first post for me on the forums :)

i've just started using autoit to (try) and make some hotkey to help me in photoshop work. What i planned to do was assign a hotkey to make the cursor to move to a set screen location so workflow is much faster... theoretically..

this is what i have now

HotKeySet("{ESC}","quit")
HotKeySet("{`}","aa")


While 1
MouseMove(31,50,0)
WEnd 


Func aa()
MouseMove(300,130,0)
EndFunc

Func quit()
Exit
EndFunc

the quit function works but the aa function does not

could someone please guide me in the right direction :)

Try another char like single quote. Although, if you precede any ALT, CTRL or SHIFT would be better.

Share this post


Link to post
Share on other sites

I think you're trying to do this

Local $ToggleX = 31
Local $ToggleY = 50
Local $ToggleCount = 1

HotKeySet("{ESC}", "quit")
HotKeySet("{`}", "aa")


While 1
    
    Sleep(1000)
    
WEnd


Func aa()
    
    If $ToggleCount = 1 Then
        $ToggleX = 300
        $ToggleY = 130
        $ToggleCount = 2
    ElseIf $ToggleCount = 2 Then
        $ToggleX = 31
        $ToggleY = 50
        $ToggleCount = 1
    EndIf
    MouseMove($ToggleX, $ToggleY, 1)
    
    
EndFunc  ;==>aa

Func quit()
    Exit
EndFunc  ;==>quit

Share this post


Link to post
Share on other sites

yes!! that works!

thank you everyone :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0