Input, SendEvent and a Hotkey

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

Expand view Topic review: Input, SendEvent and a Hotkey

Re: Input, SendEvent and a Hotkey

by Nextron » 21 Mar 2018, 15:36

It could be this The hotkey isn't a hooked hotkey. If no hook is installed by other means, it relies on #HotkeyModifierTimeout after the Send command, breaking the hotkey until you physically press control again. However, after Input is issued, the hook is installed so the modifier state is properly tracked. It looks like the hook isn't unloaded afterwards if it keeps working properly.

Try replacing the hotkey with: $^g:: so it does use the hook and it should work the first time.

Input, SendEvent and a Hotkey

by Barney » 21 Mar 2018, 14:46

The following script behaves inconsistently.

Code: Select all

SendEvent, a
Input, UserInput, T1
Keeping Control and g key pressed down produces aaggggggg.... Releasing the keys and keeping them pressed down a second time produces aaaaaaaaaa....
In the first case it is like the Control key is not put back into down state after sending a with the consequence that the hotkey is not triggered again. I don't know