Sign in to follow this  
Followers 0
onestcoder

Send Hotkeys

6 posts in this topic

If you have a script that is using a on event gui button setup is it possible to have the button run a fuction that sends a hotkey?


Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites



HotKeySet("a","somefunc")
While 1
sleep(100000)
WEnd
func somefunc()
hotkeyset('a','')
send("a")
hotkeyset('a','somefunc')
endfunc

that should help ya a bit


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

What do you mean by send a hotkey?

You can open a function with a GUI button or send a key with a GUI button, both are possible.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

What do you mean by send a hotkey?

You can open a function with a GUI button or send a key with a GUI button, both are possible.

something like

$gui = GUICreate("ONESTCODER BOTZ", 212, 75, 0, 0, -1, $WS_EX_TOPMOST)
opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

HotKeySet("{F9}", "TogglePause")

$pause = GUICtrlCreateButton("PAUSE", 75, 40, 60)
GUICtrlSetOnEvent($pause, "Pause")

Func Pause()
Send("{F9}"); this bing the  HotKeySet("{F9}", "TogglePause")
EndFunc
Func TogglePause()
    $paused = Not $paused
    $run = Not $run
    If $paused = 0 Then
        ToolTip("")
        GUICtrlSetData($pausedinput, 'RUNNING')
    ElseIf $paused = 1 Then
        Sleep(100)
        ToolTip("")
        GUICtrlSetData($pausedinput, 'PAUSED')
    EndIf
EndFunc  ;==>TogglePause
Edited by onestcoder

Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites

this seems to work

( however you do not have a while/wend loop in your "pause" )

#include <GUIConstants.au3>

Dim $paused

$gui = GUICreate("ONESTCODER BOTZ", 212, 75, 100, 100, -1, $WS_EX_TOPMOST)
opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

HotKeySet("{F9}", "TogglePause")

$pausedinput = GUICtrlCreateButton("PAUSE", 75, 40, 60)
GUICtrlSetOnEvent( -1, "Pause")
GUISetState()

While 1
    Sleep(10)
WEnd

Func Pause()
Send("{F9}"); this bing the  HotKeySet("{F9}", "TogglePause")
EndFunc
Func TogglePause()
    $paused = Not $paused
   ;$run = Not $run
    If $paused = 0 Then
        ToolTip("Running",5.5)
        GUICtrlSetData($pausedinput, 'RUNNING')
    ElseIf $paused = 1 Then
        Sleep(100)
        ToolTip("Paused",5,5)
        GUICtrlSetData($pausedinput, 'PAUSED')
    EndIf
EndFunc ;==>TogglePause

Func Terminate()
    Exit
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

so i don't need the

$run = Not $run


Need a website: http://www.iconixmarketing.com

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