Обнаружьте двойное нажатие клавиши в AutoHotkey

Я начал использовать side\palm рук для удара клавиши CTRL вместо пальцев мизинца. Мое понимание - то, что на большем количестве эргономичных клавиатур кнопка клавиши CTRL больше, который облегчает выполнять то движение.

26
задан Jake1164 28 August 2012 в 11:39
поделиться

1 ответ

Нашел ответ в документации AutoHotkey !

; Example #4: Detects when a key has been double-pressed (similar to double-click).
; KeyWait is used to stop the keyboard's auto-repeat feature from creating an unwanted
; double-press when you hold down the RControl key to modify another key.  It does this by
; keeping the hotkey's thread running, which blocks the auto-repeats by relying upon
; #MaxThreadsPerHotkey being at its default setting of 1.
; Note: There is a more elaborate script to distinguish between single, double, and
; triple-presses at the bottom of the SetTimer page.

~RControl::
if (A_PriorHotkey <> "~RControl" or A_TimeSincePriorHotkey > 400)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, RControl
    return
}
MsgBox You double-pressed the right control key.
return

Итак, для моего случая:

~Esc::
if (A_PriorHotkey <> "~Esc" or A_TimeSincePriorHotkey > 400)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, Esc
    return
}
WinMinimize, A
return
34
ответ дан 28 November 2019 в 07:35
поделиться
Другие вопросы по тегам:

Похожие вопросы: