Jump to content

Why does this not work correctly?


noto1611
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
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...