john_c wrote:Isn't it a best practice to always use KeyWait before last Return?
I realize I may have misinterpreted the question; that the emphasis may have been on always using KeyWait, and not on where to place it ("before
last Return"). It is not best practice to block key-repeat. However, if
you want to do it, KeyWait is the easiest way.
DRocks wrote:Then what is the difference, please, with using something like F11 UP:: ?
Putting KeyWait before the action, as john_c did, has a similar effect to a key-up hotkey. If you had paid attention to the topic, you would see that this effect was not desired.
john_c wrote:introduces another issue - the program will be launched when F1 released, instead of pressed.
There's nothing "drastic" about an up-hotkey. If you want to perform some action only when the key is released, it is the best way. john_c did not want to perform some action when the key was released, so an up-hotkey was not appropriate. As for your own script, that is a separate topic.
Off-topic: If you are creating the Edit control, it is not appropriate to use hotkeys, which rely on global registration or a system-wide hook. Use OnMessage to monitor WM_KEYDOWN and related messages.