Page 2 of 2

Posted: 5 Feb 2015 18:36
by ludieter
Will check it out. Thx for your input!
Dieter

global hotkeys

Posted: 14 Feb 2015 13:54
by ludieter
Thomas,

I am struggling with the sendinpput command, looked around for examples or explanations, but coming up empty.

These questions:
Where is the input Ctrl-c sent? How and in which format?
Input=k_ctrl_c,
InputString = inputStream_string::new(Input),
?
is NumberofInputs 1 (k_ctrl_c) or 2 (how to find corresponding hex of k_ctrl and 0x43)?
how do I find the SizeofInputStructure?

_=gui_native::sendinput(NumberofInputs,_,SizeofInputStructure),

Thanks in advance for your help!

Dieter

Posted: 15 Feb 2015 21:17
by Thomas Linder Puls
The keyboard input is send to the active application.

This works in some applications:

Code: Select all

        Ctrl_D = gui_api::mkKeyDown(gui_native::vk_control),         Ctrl_U = gui_api::mkKeyUp(gui_native::vk_control),         C_D = gui_api::mkKeyDown(gui_native::vk_ckey),         C_U = gui_api::mkKeyUp(gui_native::vk_ckey),         gui_api::sendInput([Ctrl_D, C_D, C_U, Ctrl_U]).
But other does not react to it.

Posted: 16 Feb 2015 6:38
by ludieter
Thanks for your reply Thomas. I am now lost but on a higher level :-) .

Where do the predicates mkkeyup and mkkeydown come from? They seem to be undeclared in gui_api.

Your sendinput/1 is also different from
sendInput : (
unsigned NumberOfInputs,
pointer Inputs [out],
integer SizeOfInputStructure)
-> unsigned NumberOfEvents

What am I missing here? I'm on VIP build 7406; does your code apply to 7.5 ?

Sorry to insist, but this is quite an important link in my program.

Posted: 16 Feb 2015 9:01
by Thomas Linder Puls
Yes, they are in gui_api (in Vip 7.5). The one you show is in gui_native.

Posted: 17 Feb 2015 19:22
by ludieter
Very helpful. I am trying with 7.5. The main problem with different windows seems to be to define which window receives the input...have not yet had time to test how to make sure I'm sending to the right window.

Posted: 18 Feb 2015 9:55
by Thomas Linder Puls
sendInput is sending its input to the active program (and that seem to be what you wanted to do).