Sign in to follow this  
Followers 0
noto1611

Why does this not work correctly?

4 posts in this topic

Hello.

I made a Script that is supposed to put stuff into the clipboard on a specified Hotkey.

The strings that will be put into the clip will be defined by the user. The Hotkeys will be ctrl f1 - f8

When I run the script and press ctrl + f8 and then press ctrl + v it pastes "5" or something.

...
GUICtrlCreateLabel ("Enter the Text you wish to set on the Hotkeys CTRL + F1 ~ F8",  20, 3)
$msg_f1 = GUICtrlCreateInput ( "Your Message for CTRL + F1.", 20, 1*$y_dist,  350, 20)
$msg_f2 = GUICtrlCreateInput ( "Your Message for CTRL + F2.", 20, 2*$y_dist,  350, 20)
$msg_f3 = GUICtrlCreateInput ( "Your Message for CTRL + F3.", 20, 3*$y_dist,  350, 20)
...
$Button_Go = GUICtrlCreateButton ("Go!",  20, 9*$y_dist, 350)

; Programme
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_Go
            
        ; Funcs
            HotKeySet("^{F1}", "setF1")
            Func setF1()
                ClipPut ($msg_f1)
            EndFunc

            HotKeySet("^{F2}", "setF2")
            Func setF2()
                ClipPut ($msg_f2)
            EndFunc

            HotKeySet("^{F3}", "setF3")
            Func setF3()
                ClipPut ($msg_f3)
            EndFunc

            ...

            GUISetState(@SW_HIDE)
    EndSelect
Wend

Share this post


Link to post
Share on other sites



Read in the helpfile what's said about the return value of GUICtrlCreateInput... Also, read the first line under remarks.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Btw...in your script, do you actually have those functions in the loop ? If so, then I suggest you move them to

the end of your script.

EDIT : Last thing...in your next topics, please find a more fitting topic-title. After three years of topics in a

support- forum you would think there's been a few people who's had problem getting "something" working

correctly before...

Edited by Helge

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