A_HotkeyModifierTimeout

A_HotkeyModifierTimeout is a built-in variable that affects the behavior of Send with hotkey modifiers Ctrl, Alt, Win, and Shift. Specifically, it defines how long after a hotkey is pressed that its modifier keys are assumed to still be held down. This is used by Send to determine whether to push the modifier keys back down after having temporarily released them.

A_HotkeyModifierTimeout can be used to get or set an integer representing the length of the interval in milliseconds. If -1, it never times out (modifier keys are always pushed back down after the Send). If 0, it always times out (modifier keys are never pushed back down).

The default setting is 50 (ms).

備考

この変数は、以下の場合に効果がありません。

この変数の効果を説明するために、この例を考えてみましょう。^!a::Send "abc".

Send関数が実行されると、まずCtrlAltを解除して、文字が正しく送信されるようにします。すべてのキーを送信した後、関数はCtrlAltを安全に押し戻せるかどうか(ユーザーがまだ押し続けているかどうかを確認するため)わからない。しかし、指定されたミリ秒未満しか経過していない場合は、ユーザーがまだキーを離す機会がなかったと判断し、物理的な状態に合わせてキーを押し戻します。そうしないと、修飾キーが押し戻されず、同じキーや別のキーを修飾させるために、ユーザーは一旦キーを離して再度押す必要があります。

タイムアウトは、ユーザーが通常ホットキーの修飾子を押したまま離す時間よりも短い値に設定する必要があります。そうでないと、ユーザーが物理的に押さえていなくても、モディファイアがダウンポジションに復元される(ダウンで動かなくなる)可能性があります。

以下のいずれかで、この変数の必要性を低減または排除することができます。

GetKeyState

Sets the hotkey modifier timeout to 100 ms instead of 50 ms.

A_HotkeyModifierTimeout := 100