From 45e5195ad2807bfdb880a4533557647aa71d13b4 Mon Sep 17 00:00:00 2001 From: lazarus Date: Sat, 17 Aug 2002 23:40:53 +0000 Subject: [PATCH] MG: fixed stopping keypress event if handled by LCL git-svn-id: trunk@2084 - --- lcl/interfaces/gtk/gtkcallback.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index a73567f11d..eb03e54aa0 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -493,7 +493,7 @@ begin Event^.theString[0] := Char(Msg.CharCode); {$EndIf} Event^.KeyVal := Msg.CharCode; - If Msg.CharCode <> 0 then + If Msg.CharCode <> VK_UNKNOWN then KeyCode := Msg.CharCode else KeyCode := $FFFF; @@ -519,7 +519,9 @@ begin TObject(Data).Dispatch(Msg); Result := (Msg.Result=0); {$ENDIF} - If Msg.CharCode <> KeyCode then + If Msg.CharCode <> KeyCode then begin + // key was handled by lcl + gtk_signal_emit_stop_by_name (GTK_OBJECT (Widget), 'key_press_event'); If ((Msg.CharCode >= 31) and (Msg.CharCode <= 255)) or (Msg.CharCode = 0) then begin @@ -528,6 +530,7 @@ begin {$EndIf} Event^.KeyVal := Msg.CharCode; end; + end; end; //This is disabled on account of the //strange behaviour in TSynEdit @@ -2461,6 +2464,9 @@ end; { ============================================================================= $Log$ + Revision 1.141 2002/10/06 20:24:27 lazarus + MG: fixed stopping keypress event if handled by LCL + Revision 1.140 2002/10/04 20:46:52 lazarus MG: improved TComboBox.SetItemIndex