[lazarus] TSynEdit keystrokes in win32 interface

Micha Nelissen M.Nelissen at student.tue.nl
Wed Aug 13 08:13:59 EDT 2003


Mattias Gaertner wrote:

> On Wed, 13 Aug 2003 14:14:48 +0200
> "Marc Weustink" <marc.weustink at cuperus.nl> wrote:
> 
> 
>>+ From: Micha Nelissen [mailto:M.Nelissen at student.tue.nl]
>>+ Sent: woensdag 13 augustus 2003 13:59
>>+
>>+ Hi,
>>+
>>+ Can anyone explain about synedit keystrokes. If I press a 'b', then it
>>+ tries to find an associated command with findkeycode2 and findkeycode,
>>+ but on my system it returns with ecNone, so no action is done.
>>+
>>+ Is there something I missed?
>>
>>Don't know. But a tip. If you have delphi, try to use TSynedit with it.
>>Then you can see what to expect and what not.
> 
> 
> 'b' is no special key, and therefore handled in the keypress event.

Thanks for the hint, solved the bug quickly now :). Attached is a patch 
for it. Apply in win32 interface please.

Micha.


--- win32callback.old.inc	Wed Aug 13 12:52:56 2003
+++ win32callback.inc	Wed Aug 13 14:40:34 2003
@@ -93,6 +93,7 @@
   LMInsertText: TLMInsertText; // used by CB_INSERTSTRING, LB_INSERTSTRING
   LMScroll: TLMScroll; // used by WM_HSCROLL
   LMKey: TLMKey; // used by WM_KEYDOWN WM_KEYUP
+  LMChar: TLMChar; // used by WM_CHAR
   LMMouse: TLMMouse; // used by WM_LBUTTONDBLCLK
   LMMouseMove: TLMMouseMove; // used by WM_MOUSEMOVE
   LMMouseEvent: TLMMouseEvent; // used by WM_MOUSEWHEEL
@@ -190,6 +191,17 @@
         NewText := PChar(LParam);
         Length := System.Length(NewText);
 //        UserData := Pointer(GetWindowLong(Window, GWL_USERDATA));
+      End;
+    End;
+    WM_CHAR:
+    Begin
+      PLMsg:=@LMChar;
+      With LMChar Do
+      Begin
+        Msg := LM_CHAR;
+        KeyData := LParam;
+        CharCode := WParam;
+        writeln('WM_CHAR KeyData=',KeyData,' CharCode=',CharCode);
       End;
     End;
     WM_CLOSE:





More information about the Lazarus mailing list