Jump to content

Hotkeys are not functioning


gda
 Share

Recommended Posts

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
Link to comment
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.
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...