/ / Tasto di scelta rapida per attivare un altro tasto di scelta rapida in una funzione o modalità diversa - autohotkey

Tasto di scelta rapida per attivare un altro tasto di scelta rapida in una diversa funzione o modalità - autohotkey

Sto cercando di ottenere il tasto di scelta rapida LCTRL da attivareXButton2 in diverse modalità. Il problema è che sta dicendo che ci sono tasti di scelta rapida duplicati nello stesso script. Non so chiaramente cosa sta succedendo. Aiuto?

~LCtrl::
actioncameratoggle := !actioncameratoggle
if actioncameratoggle
{
~XButton2::
rTurn := !rTurn
if rTurn
{
send {lctrl}
mousemove, 800, 450
send {ctrl}
mousemove, 1600, 450
}
else
{

}
}
else
{
~XButton2::
{

}
}
return

Grazie!

risposte:

0 per risposta № 1

Con lo script non è possibile attivare gli stessi tasti di scelta rapida, il motivo è che si desidera utilizzare il Se con il Altro comandi> if hotkey1:: else hotkey1::, avrai bisogno del #Se comandi. Guarda questo codice di esempio.

Puoi scrivere questo codice example.ahk e provarlo sul tuo sistema Windows.

Cambia il codice un po 'per le tue esigenze, ed è fatto.

Ho fatto la sceneggiatura in modo che gli altri ragazzi possano testarlo facilmente.

; [+ = Shift] [! = Alt] [^ = Ctrl] [# = Win]

a := 1

#If mode1 ; All hotkeys below this line will only work if mode1 is TRUE or 1
t::1
; Here you can put your first hotkey code ~XButton2::
#If

#If mode2 ; All hotkeys below this line will only work if mode2 is TRUE or 1
t::2
; And here you can put your second hotkey code ~XButton2::
#If

; toggle between [t::1] and [t::2]
;a = 1   => t::1
;a = 2   => t::2

;type LCtrl key to toggle between two the same hotkeys
;you can test it out in notepad - if you then type the key t
~LCtrl::
if (a=1)
{
mode1 = 1
mode2 = 0
a := 2
}else{
mode1 = 0
mode2 = 1
a := 1
}