[lazarus] Context sensitive help
Tony Maro
tony at maro.net
Sun Apr 20 00:04:37 EDT 2003
Mattias Gaertner wrote:
>I think, an application wide KeyDown event would be very useful. Not only
>for a helpsystem. I have added a handler chain to Application.
>Just add your keydown event with:
>
>Application.AddOnKeyDownHandler(@AppKeyDown);
>
>This keydown is invoked, if no other component used the key
>(Key<>VK_Unknown).
>
>
>
I've been playing around with this event, and found that it is called
twice for each keypress.
Once the Sender object is some blank object that claims it is a
TWinControl (at least a descendant of) but has no name in the name
property, and then a second time for the actual object that has focus.
I never could figure out what the first object sent to the event was...
a few if (Sender is XXXX) let me know that it's at least a TWinControl
descendant, but it wasn't the TEdit control that I was hitting the key
in, because when compared as (Sender is TEdit) it wasn't...
And like I said the name property of the object in the first call is blank.
-Tony
More information about the Lazarus
mailing list