SetCapsLockState/SetNumLockState/SetScrollLockState

Sets the state of the Capslock/NumLock/ScrollLock key. Can also force the key to stay on or off.

SetCapsLockState, State

SetNumLockState, State

SetScrollLockState, State

 

Parameters

State

On: Toggles the key into the "on" state.

Off: Toggles the key into the "off" state.

AlwaysOn: Forces the key to be always-on (has no effect on Windows 9x).

AlwaysOff: Forces the key to be always-off (has no effect on Windows 9x).

 

Remarks

Keeping a key AlwaysOn or AlwaysOff requires the keyboard hook, which will be automatically installed in such cases.

These commands are currently not 100% reliable on Windows Me/98/95 due to the limitations of those OSes. As an alternative, a key can be reliably toggled to its opposite state on Win9x via the Send command. For example: Send, {Capslock}

 

Related

SetStoreCapslockMode, GetKeyState

 

Example

SetNumlockState, on
SetScrollLockState, AlwaysOff