Alaska Software Inc. - Detect key combination while activex in focus
Username: Password:
AuthorTopic: Detect key combination while activex in focus
Peter NagyDetect key combination while activex in focus
on Tue, 17 Sep 2019 15:11:45 +0200
Dear XBase++ Team,

I have an activex control, which is render PDF documents. If the user click 
in the activex control, It becomes the active component in the window, and 
it block all the events outside the activex control. Is there a way to 
detect key combinations, even if the activex is selected? For instance, We 
need to add a key combination CTRL+Z to zoomIn the page, I need to call a 
function, but the activex block all the events, and our window object cannot 
see the pressed keys. Can you help us?
Thank you!

Best regards,
Steven
Jim LeeRe: Detect key combination while activex in focus
on Tue, 17 Sep 2019 21:26:47 +0200
hi,

> I have an activex control, which is render PDF documents.

so what is the Name of that activeX ?

---

ActiveX often have there own Event loop but you can "Sub-Class" it and write
your Event-Loop.
ActiveX can send Event so you need to "SubscribeEvent()" to get those Events



---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com
Peter NagyRe: Detect key combination while activex in focus
on Wed, 18 Sep 2019 12:08:47 +0200
"so what is the Name of that activeX ?"
Its called sorax (http://www.soraxsoft.com/).

"ActiveX often have there own Event loop but you can "Sub-Class" it and 
write your Event-Loop."
I am not sure what do you mean, but I created a new class from 
XbpActiveXControl, and I overwrited the ComDefaultEventHandler method. Its 
called when I click or scroll, but no luck for keyboard events.

"ActiveX can send Event so you need to "SubscribeEvent()" to get those 
Events"
I use this events for the PDF viewer, like pageChanged, but no keyboard 
like events implemented.

Maybe, there is not really a workaround because the creator not 
implemented?
Bad, but at least any solution is global hotkey (+check if my window is in 
focus).

If I need to use the global hotkey solution, can you help me with that?
So I register a global hotkey (https://docs.microsoft.com/en-
us/windows/win32/api/winuser/nf-winuser-registerhotkey) and in my App 
EventLoop I can get the WM_HOTKEY messages?

Thanks!
Jim LeeRe: Detect key combination while activex in focus
on Thu, 19 Sep 2019 09:07:56 +0200
XbpActiveXControl() have o:keyBoard Callback Slot so try this first

XbpActiveXControl() have o:keyDown() which you can override in your own
Class

COMDefaultHandler( nDISPID, ...)
it work work with nDISPID which are published like DISPID_KEYDOWN

---

>For instance, We need to add a key combination CTRL+Z to zoomIn the page

is there any Method to "Zoom" ?
normal "Zoom" is using Wheel or Touch

you can also make a (big) Button to call a Method

> If I need to use the global hotkey solution, can you help me with that?
> So I register a global hotkey (https://docs.microsoft.com/en-
> us/windows/win32/api/winuser/nf-winuser-registerhotkey) and in my App
> EventLoop I can get the WM_HOTKEY messages?

wrong way.
you can only :subscribeEvent() and react on a Event send by ActiveX Control
most Control simply does not react on Keyboard ...Windows use Mouse





---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com