#MaxThreadsBuffer

ホットキーの一部または全部が、#MaxThreadsPerHotkeyの制限に達した場合、キー入力を無視するのではなく、バッファリングするようになります。

#MaxThreadsBuffer Setting

パラメータ

設定

省略されたときは、初期設定は<e4>True</e4>になります。Otherwise, specify one of the following literal values:

True または 1:ここから次の#MaxThreadsBuffer False指令までのすべてのホットキーサブルーチンは、そのサブルーチンが#MaxThreadsPerHotkeyの限界に達したときに、ホットキーの押下を無視するのではなく、バッファリングします。

False または 0:ホットキーがすでに最大スレッド数(通常は1ですが、#MaxThreadsPerHotkeyで変更可能)を実行している場合は、ホットキーを押しても無視されます。

備考

If this directive is unspecified in the script, it will behave as though set to False.

This directive is rarely used because this type of buffering usually does more harm than good. 例えば、誤ってホットキーを2回押してしまった場合、この設定をONにすると、そのホットキーのサブルーチンは、最初のスレッドが1秒未満で終了した場合、自動的に2回目を実行します(このタイプのバッファは、設計上1秒後に終了します)。Note that AutoHotkey buffers hotkeys in several other ways (such as Thread Interrupt and Critical). ただ、この特殊な方法は有害であるため、デフォルトでオフになっています。

このディレクティブの主な用途は、キーボードのオートリピート機能の応答性を高めることです。たとえば、#MaxThreadsPerHotkeyの設定が1(デフォルト)のホットキーを押し続けているとき、そのホットキーサブルーチンがすでに実行されていると、キー入力は無視されます。Thus, when the subroutine finishes, it must wait for the next auto-repeat keypress to come in, which might take 50 ms or more due to being caught in between keystrokes of the auto-repeat cycle. This 50 ms delay can be avoided by enabling this directive for any hotkey that needs the best possible response time while it is being auto-repeated.

他の#ディレクティブと同様に、このディレクティブもスクリプト内で関数であるかのように位置づけるべきではありません(つまり、サブルーチンの中に含ませる必要はありません)。代わりに、その影響を受けさせたい最初のホットキーの直前に配置します。

他のディレクティブと同様に、#MaxThreadsBufferは条件付きで実行することはできません。

#MaxThreads, #MaxThreadsPerHotkey, Critical, Thread (function), Threads, Hotkey, A_MaxHotkeysPerInterval, ListHotkeys

最初の2つのホットキーが#MaxThreadsPerHotkeyの制限に達した場合、キー入力を無視するのではなく、バッファリングするようにします。

#MaxThreadsBuffer True
#x::MsgBox "This hotkey will use this type of buffering."
#y::MsgBox "And this one too."
#MaxThreadsBuffer False
#z::MsgBox "But not this one."