AutoHotKey frage?

2 Antworten

Das Setzen von Kommas würde die Frage etwas verständlicher machen.

Du möchtest also eine Reaktion auf eine Taste, die die erst durch eine Variable bestimmt wird? Wie wird der Variablen den ein bestimmter Wert zugewiesen?


KACKBIENCHEN 
Fragesteller
 22.05.2021, 18:31

ja, und:

#NoEnv
#SingleInstance Force
StartKeyL:= "R"
StartKeyR:= "F"


Hotkey, %StartKeyL%, START
Hotkey, %StartKeyR%, START


Gui,1:Font, S8 CRed, Verdana
Gui,1:Add, Text, x2 y-1 w100 h30 , LButton`, Button to start/stop
Gui,1:Add, Text, x2 y29 w100 h30 , RButton`, Button to start/stop
Gui,1:Add, Text, x2 y60 w100 h30 , Delay after every click in ms
Gui,1:Add, Edit, x102 y60 w200 h30, 
Gui,1:Add, Hotkey, x102 y-1 w100 h30 vStartKeyL, %StartKeyL%
Gui,1:Add, Hotkey, x102 y29 w100 h30 vStartKeyR, %StartKeyR%
Gui,1:Add, Button, x202 y-1 w100 h30 gSaveL, Save
Gui,1:Add, Button, x202 y29 w100 h30 gSaveR, Save
Gui,1:Add, CheckBox, x102 y110 w100 h30 vCheck gUpdate, AlwaysOnTop on/off
Gui,1:Add, Button, x102 y150 w100 h30 gSTART, start
Gui,1:Add, Button, x12 y189 w100 h30 gexit, Exit
Gui,1:Add, Button, x192 y189 w100 h30 greload, Reload
Gui,1:color,Black
; Generated using SmartGUI Creator for SciTE
Gui,1:Show, w306 h239, Untitled GUI
return


GuiClose:
ExitApp






Update:
    Gui,1:Submit, NoHide
    If Check = 1
    {
        Gui,1:+AlwaysOnTop
    }
    else
    {
        Gui,1:-AlwaysOnTop
    }
Return
SaveL:
GuiControlGet,New_KeyL,1:,StartKeyL
if(New_KeyL!=StartKeyL)
{
Hotkey, %StartKeyL%, START,off
StartKeyL:=New_KeyL
Hotkey, %StartKeyL%, START,on
}
return


SaveR:
GuiControlGet,New_KeyR,1:,StartKeyR
if(New_KeyR!=StartKeyR)
{
Hotkey, %StartKeyR%, START,off
StartKeyR:=New_KeyR
Hotkey, %StartKeyR%, START,on
}
return


START:




return


reload:
Reload




exit:
ExitApp


	
0

Versuch es mal mit folgenden Beispiel.

Hotkey1 = ^+#F1 ; Strg+Umschalt+LWin+F1 drücken
Hotkey2 = F2 ; F2 drücken

Hotkey, %Hotkey1%, Hotkey1
Hotkey, %Hotkey2%, Hotkey2
return

Hotkey1:
MsgBox, Aktion1
return

Hotkey2:
MsgBox, Aktion2
return