0

As two separate scripts the hotkeys work as expected. Combining into one file the #^l and #^h hotkeys stop working. Is it a glitch or am I doing something wrong?

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey 
releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

LAlt::LWin
LWin::LAlt
CapsLock::LCtrl

#^l::#^Right
#^h::#^Left

2 Answers 2

0
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

LAlt::LWin
LWin::LAlt
CapsLock::LCtrl

; LAlt+CapsLock+l ; switch to next virtual desktop
#^l:: SendEvent {LWin down}{LCtrl down}{Right down}{LWin up}{LCtrl up}{Right up}
; LAlt+CapsLock+h ; switch to previous virtual desktop
#^h:: SendEvent {LWin down}{LCtrl down}{Left down}{LWin up}{LCtrl up}{Left up}

https://autohotkey.com/docs/commands/Send.htm#SendEvent

Tested on Win10.

0

Try this :

LAlt::
Send, {LWin down}
Send, {LWin up}
return

LWin::
Send, {Alt down}
Send, {Alt up}
return
2
  • Thanks for the reply, with this solution the Windows Tab function no longer works, and it does not resolve the previous issue.
    – OrigamiEye
    Nov 3, 2018 at 18:00
  • I just corrected these two problems, and the others can be solved similarly: You cannot map these because they are not real characters that can be replaced but events. You need to emulate the functionality of the keys by sending the up&down events.
    – harrymc
    Nov 3, 2018 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .