Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Reliable shift/control key press detection
Tue, Sep 19 2017 7:37 AMPermanent Link

Matthew Jones

Has anyone worked out how to get the key press event to trigger reliably? Or perhaps, where to put it, to have it run reliably.

The situation is that I have a form and it has a child form. And some more, but probably not relevant. Both have KeyPress event handlers. When my application starts, I can press Control but neither trigger. If I click on a few places, nothing changes. On other places, like an edit box, then they both trigger just fine. Now, clicking around on labels etc doesn't change anything, but clicking on a TIcon stops it working again.

I need to be able to Ctrl-click to multi-select, but this is not reliable. If there is a way to find out the current Control or Shift state without monitoring the events, that would be an ideal alternative.

--

Matthew Jones
Fri, Sep 22 2017 1:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Has anyone worked out how to get the key press event to trigger reliably? Or perhaps, where to put it, to have it run reliably. >>

You're really only going to be able to get OnKeyPress event handlers to trigger reliably on controls that accept input (edit, link, etc.).  So, for a container control to get a keypress event it is going to need at least one of those types of controls as child controls, and in such cases will get OnKeyPress events as "preview" events that it can handle before the event is dispatched to the child control itself.

Tim Young
Elevate Software
www.elevatesoft.com
Image