Discussions related to Visual Prolog
ludieter
Posts: 23
Joined: 21 Dec 2010 19:40

Unread post by ludieter »

Will check it out. Thx for your input!
Dieter
ludieter
Posts: 23
Joined: 21 Dec 2010 19:40

global hotkeys

Unread post 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
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post 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.
Regards Thomas Linder Puls
PDC
ludieter
Posts: 23
Joined: 21 Dec 2010 19:40

Unread post 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.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Yes, they are in gui_api (in Vip 7.5). The one you show is in gui_native.
Regards Thomas Linder Puls
PDC
ludieter
Posts: 23
Joined: 21 Dec 2010 19:40

Unread post 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.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

sendInput is sending its input to the active program (and that seem to be what you wanted to do).
Regards Thomas Linder Puls
PDC
Post Reply