Sandro
Sandro

Reputation: 463

Alternative to capslock in scripts

I have been using Autohotkey and many triggers involving the Capslock key on my laptop for a long time.

I am also using Synergy v1 from Symless to share mouse and keyboard from my desktop computer with the laptop. Synergy doesn't share the CapsLock status with the remote computer, but I obviously still want to use my key combos on the remote device.

I can sent another key, e.g. F13 instead of CapsLock, but how do I now make the windows computer behave as if CapsLock has been pressed?

F13::Capslock

That makes F13 toggle the Capslock state, but doesn't trigger anything else

#InputLevel 1
F13::Capslock
#InputLevel 0

That I thought would hide the F13::Capslock mapping for the other triggers and make it appear as if Capslock had been pressed locally, but also doesn't help.

Added trigger examples:

Capslock & j::Send {Blind}{Left DownTemp}
Capslock & j up::Send {Blind}{Left Up}

Left arrow on the j

Capslock & w::SendInput {Alt down}{F4}{Alt up}

Close app on w

Upvotes: 1

Views: 55

Answers (1)

Sandro
Sandro

Reputation: 463

I have simplified the key mappings on the local computer side and now it works almost without hitches. I guess there was some interference with other mappings and thus no "clean" sending of F13 down and up. The application switcher via AltTab and ShiftAltTab gets the alt key stuck still, but that is a minor issue

In summary

#InputLevel 1
F13::Capslock
#InputLevel 0

This works because it hides the mappings from all the other mappings in my file because of the higher input level. The other mappings then work, as if CapsLock had actually been pressed locally.

No need to adapt the script on the remote computer in any other way for me

Upvotes: 0

Related Questions