global hotkeys

Discussions related to Visual Prolog
ludieter
Active Member
Posts: 29
Joined: 21 Dec 2010 19:40

Unread post by ludieter » 5 Feb 2015 18:36

Will check it out. Thx for your input!
Dieter

ludieter
Active Member
Posts: 29
Joined: 21 Dec 2010 19:40

global hotkeys

Unread post by ludieter » 14 Feb 2015 13:54

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: 1668
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 15 Feb 2015 21:17

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
Active Member
Posts: 29
Joined: 21 Dec 2010 19:40

Unread post by ludieter » 16 Feb 2015 6:38

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: 1668
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 16 Feb 2015 9:01

Yes, they are in gui_api (in Vip 7.5). The one you show is in gui_native.
Regards Thomas Linder Puls
PDC

ludieter
Active Member
Posts: 29
Joined: 21 Dec 2010 19:40

Unread post by ludieter » 17 Feb 2015 19:22

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: 1668
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 18 Feb 2015 9:55

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