Hi.
I'm new to AKH and all I learned so far is the remap :: and the basic use of send utilities.
I learned about the "Suspend" command which allows me to assign a key to enable/disable the script. What I want to do is to assign the ScrollLock to the Suspend command but I also want it to toggle the LED light on/off. So I have a visual cue whether the script is on or off. Can anyone help me with the correct way to do it please?
ScrollLock to suspend on/off and to turn LED on/off
-
- Posts: 3
- Joined: 10 Apr 2018, 01:50
-
- Posts: 3
- Joined: 10 Apr 2018, 01:50
Re: ScrollLock to suspend on/off and to turn LED on/off
I have actually figured the solution after a couple of minutes of research and trials.
The code is:
The important thing here is to place the "Suspend, Toggle" command before the "Send {ScrollLock}" command. If you switch the order of these 2 commands then it won't work.
The code is:
Code: Select all
ScrollLock::
Suspend, Toggle
Send {ScrollLock}
return ;
Re: ScrollLock to suspend on/off and to turn LED on/off
I have the same suspend hotkey, but I prefer the following method:~ to retain native function opposed to re-triggering itself, possible looping. Suspend % GetKeyState ... to match the suspend state to the LED state, in case suspend was set by other means.
Code: Select all
~ScrollLock::
Suspend Permit
Sleep,10
Suspend % GetKeyState("ScrollLock","T") ? "On" : "Off"
Return
-
- Posts: 3
- Joined: 10 Apr 2018, 01:50
Re: ScrollLock to suspend on/off and to turn LED on/off
I'm not fully sure what your code does opposite to mine, but does it just turns the LED light on/off without really activating the scrolllock?Nextron wrote:I have the same suspend hotkey, but I prefer the following method:~ to retain native function opposed to re-triggering itself, possible looping. Suspend % GetKeyState ... to match the suspend state to the LED state, in case suspend was set by other means.Code: Select all
~ScrollLock:: Suspend Permit Sleep,10 Suspend % GetKeyState("ScrollLock","T") ? "On" : "Off" Return
Who is online
Users browsing this forum: CuriousDad, Google [Bot], rc76 and 233 guests