Discussion:
SendKeys from github
(too old to reply)
Tom Del Rosso
2024-08-22 12:40:25 UTC
Permalink
This is extremely useful:

https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/sendKeys.bat

But the special key codes (suggested by the author Vasil Arnaudov AKA
npocmaka) don't always work:

http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
--
Defund the Thought Police
Tom Del Rosso
2024-08-30 12:48:38 UTC
Permalink
Post by Tom Del Rosso
https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/sendKeys.bat
But the special key codes (suggested by the author Vasil Arnaudov AKA
http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
I just discovered that it is also capable of 'sending keys' to a process
that runs as another user so the window is invisible. The batch file is
running invisibly as the same user, which might be necessary but hasn't
been proven so yet.
--
Defund the Thought Police
JJ
2024-08-31 12:22:27 UTC
Permalink
Post by Tom Del Rosso
Post by Tom Del Rosso
https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/sendKeys.bat
But the special key codes (suggested by the author Vasil Arnaudov AKA
http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
I just discovered that it is also capable of 'sending keys' to a process
that runs as another user so the window is invisible. The batch file is
running invisibly as the same user, which might be necessary but hasn't
been proven so yet.
It does work but only under specific condition.

For invisible window or any window which doesn't have the keyboard input
focus, it would only work if the sent key(s) match either a global hotkey
(from Hotkey API), or a global keyboard shortcut (from low-level keyboard
hook API).

Otherwise it won't work, since by default, windows which don't have the
keyboard input focus will never receive any keyboard event.
Tom Del Rosso
2024-09-02 04:10:00 UTC
Permalink
Post by JJ
It does work but only under specific condition.
For invisible window or any window which doesn't have the keyboard
input focus, it would only work if the sent key(s) match either a
global hotkey (from Hotkey API), or a global keyboard shortcut (from
low-level keyboard hook API).
Otherwise it won't work, since by default, windows which don't have
the keyboard input focus will never receive any keyboard event.
It was just a space character. I never set hotkeys so I don't know about
that API.
--
Defund the Thought Police
Tom Del Rosso
2024-09-21 12:17:25 UTC
Permalink
Post by JJ
It does work but only under specific condition.
For invisible window or any window which doesn't have the keyboard
input focus, it would only work if the sent key(s) match either a
global hotkey (from Hotkey API), or a global keyboard shortcut (from
low-level keyboard hook API).
Otherwise it won't work, since by default, windows which don't have
the keyboard input focus will never receive any keyboard event.
I was hoping it could copy the contents of a command window
with "% ES{ENTER}" but it doesn't work even if the window has the focus.
It can send keys though, just not alt-keys, to a command window. But it
does send alt-keys to other windows.
--
Defund the Thought Police
Loading...