[Lazarus] GTK2: PostMessage(..., LM_CHAR, ...) and IntfUTF8KeyPress(...)

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Jun 30 08:55:17 CEST 2010


On Tue, 29 Jun 2010 14:54:54 +0300
Žilvinas Ledas <zilvinas.ledas at dict.lt> wrote:

> 
> 
> On 2010-06-29 01:57, Paul Ishenin wrote:
> >  29.06.2010 5:13, Žilvinas Ledas wrote:
> >> 1.
> >>  PostMessage(currentEdit.Handle, LM_CHAR, Ord('a'), 0); // trying to 
> >> post msg to some TEdit
> >>
> >> 2.
> >>  UTF8Key := 'a';
> >>  currentEdit.IntfUTF8KeyPress(UTF8Key, 1, false);
> >>
> >>
> >> Should these code snippets do something, or it is OK that they have 
> >> no effect? I am using FPC 2.5.1 [2010/06/09] and todays SVN Lazarus 
> >> on Ubuntu 9.X .
> > Well, at least they don't emulate key presses if you needed that but 
> > they must call the appropriate handlers in the edit component.
> >
> By the way, none of KeyPress() KeyUp() dUTF8KeyPress() hanlers are 
> called when PostMessage(currentEdit.Handle, LM_CHAR, Ord('a'), 0); is 
> sent. Is this intended behaviour?

Yes. LM_CHAR normally triggers OnKeyPress, but TCustomEdit eats that.

Mattias




More information about the Lazarus mailing list