S
S
spacemakerman2021-12-26 19:12:36
autohotkey
spacemakerman, 2021-12-26 19:12:36

How to implement the AHK script so that when on. CapsLock, the condition was met and when off. stopped running?

Hello everyone, I recently started to master AHK, figured out simple tasks, but how can I implement this?

If the CapsLock mode is enabled, then holding down the left mouse button reassigns to an action: for example, cyclic pressing of the "1" key. But as soon as the CapsLock mode is turned off, the left mouse button is not reassigned and works in standard mode.

GetKeyState, CapLck, CapsLock, T
if ( CapLck == "D" ) {

MouseClick, left,,, 1, 0, D  ; Удерживать нажатой левую кнопку.
Loop
{
Send {I down}
Sleep, 100
Send {I up}
Sleep, 100
}
MouseClick, left,,, 1, 0, U  ; Отпустить кнопку мыши.
}
return

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
ComodoHacker, 2021-12-26
@spacemakerman

Maybe use ~RButton and check GetKeyState() inside?

K
kyb85, 2022-02-15
@kyb85

#If GetKeyState("CapsLock", "T") ; only work when CapsLock is enabled

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question