View Issue Details

IDProjectCategoryView StatusLast Update
0014063LazarusLCLpublic2010-08-19 08:40
ReporterDenis GolovanAssigned ToMarc Weustink 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.27 (SVN)Product Build 
Target Version1.0.0Fixed in Version0.9.29 (SVN) 
Summary0014063: Shift state in always full
DescriptionWhenever mouse wheel event is triggered, Shift set contains all possible values.
Alt, Shift and other key modifiers do not change anything.

I'm using Linux version
Lazarus - SVN rev 20745
FPC - SVN rev 13307

Test case attached
TagsNo tags attached.
Fixed in Revision27086,27087
LazTarget1.0
WidgetsetGTK 2
Attached Files

Relationships

related to 0017155 closedMaxim Ganetsky Regression: TPaintBox.OnMouseWheel is never called 

Activities

2009-06-26 19:11

 

Mouse-wheel-shift-values.tar.gz (5,454 bytes)

Denis Golovan

2009-06-26 19:15

reporter   ~0028775

Seems like any widgetset behaves the same. Tested on win32 also

Denis Golovan

2009-06-26 21:59

reporter   ~0028777

Below is a dirty hack to make it work.
Just to have the idea what should be patched

Index: include/wincontrol.inc
===================================================================
--- include/wincontrol.inc (revision 20748)
+++ include/wincontrol.inc (working copy)
@@ -4872,6 +4872,12 @@
     LM_RBUTTONTRIPLECLK,
     LM_RBUTTONQUADCLK:
        begin
+ if Message.Msg = LM_MOUSEWHEEL then
+ begin
+ WMMouseWheel( PLMMouseEvent(@Message)^ );
+ Exit;
+ end;
+
          {$IFDEF VerboseMouseBugfix}
          DebugLn('TWinControl.WndPRoc A ',Name,':',ClassName);
          {$ENDIF}

Denis Golovan

2009-06-27 09:05

reporter   ~0028783

One more issue - previous patch correctly report Caps Lock as pressed in mouse wheel event, OnMouseMove doesn't

Denis Golovan

2010-08-12 20:28

reporter   ~0040168

Correct patch for shift states, imho.

diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc
index 91a44fe..d4f432e 100644
--- a/lcl/include/wincontrol.inc
+++ b/lcl/include/wincontrol.inc
@@ -4581,8 +4581,15 @@ begin
       );
       {$ENDIF}
     end;
+ {
+ //Perform creates general TLMessage, thus loosing all mouse specific fields.
+ //e.g. ShiftState for such messages are always full.
+ //See http://bugs.freepascal.org/view.php?id=14063
     TheMessage.Result := Control.Perform(TheMessage.Msg, WParam(TheMessage.Keys),
                          LParam(Integer(PointToSmallPoint(P))));
+ }
+ Control.Dispatch(TheMessage);
+
     Result := True;
   end;
 end;

Paul Ishenin

2010-08-13 04:52

manager   ~0040173

Please test and close if ok.

Denis Golovan

2010-08-13 07:38

reporter   ~0040176

Committed change does not send message to the right control.
Form handles it.

It should be:
    if MouseMessage.Msg = LM_MOUSEWHEEL then
    begin
      MouseEventMessage := TLMMouseEvent(TheMessage);
      MouseEventMessage.X := P.X;
      MouseEventMessage.Y := P.Y;
      Control.Dispatch(MouseEventMessage); //Control should get it!
      MouseMessage.Result := MouseEventMessage.Result;

With that my change, mouse wheel messages (OnMouseWheel, OnMouseWheelDown/Up) work fine.

And I still don't understand, why it is necessary to recreate event message?

Paul Ishenin

2010-08-13 10:45

manager   ~0040177

Sorry for the typo. I fixed it, thanks.

The reason is that we are changing the Pos and we need to sent the updated pos to the child, not the original one.

Denis Golovan

2010-08-19 08:40

reporter   ~0040275

Thanks. It works now.

Issue History

Date Modified Username Field Change
2009-06-26 19:11 Denis Golovan New Issue
2009-06-26 19:11 Denis Golovan File Added: Mouse-wheel-shift-values.tar.gz
2009-06-26 19:11 Denis Golovan Widgetset => GTK 2
2009-06-26 19:15 Denis Golovan Note Added: 0028775
2009-06-26 21:59 Denis Golovan Note Added: 0028777
2009-06-27 09:05 Denis Golovan Note Added: 0028783
2009-06-28 20:43 Vincent Snijders LazTarget => 1.0
2009-06-28 20:43 Vincent Snijders Status new => acknowledged
2009-06-28 20:43 Vincent Snijders Target Version => 1.0.0
2009-06-30 01:00 Marc Weustink Status acknowledged => assigned
2009-06-30 01:00 Marc Weustink Assigned To => Marc Weustink
2010-08-12 20:28 Denis Golovan Note Added: 0040168
2010-08-12 22:42 Maxim Ganetsky Relationship added child of 0017155
2010-08-12 22:43 Maxim Ganetsky Relationship deleted child of 0017155
2010-08-12 22:43 Maxim Ganetsky Relationship added related to 0017155
2010-08-13 04:52 Paul Ishenin Fixed in Revision => 27086
2010-08-13 04:52 Paul Ishenin Status assigned => resolved
2010-08-13 04:52 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-08-13 04:52 Paul Ishenin Resolution open => fixed
2010-08-13 04:52 Paul Ishenin Note Added: 0040173
2010-08-13 07:38 Denis Golovan Status resolved => assigned
2010-08-13 07:38 Denis Golovan Resolution fixed => reopened
2010-08-13 07:38 Denis Golovan Note Added: 0040176
2010-08-13 10:45 Paul Ishenin Fixed in Revision 27086 => 27086,27087
2010-08-13 10:45 Paul Ishenin Status assigned => resolved
2010-08-13 10:45 Paul Ishenin Resolution reopened => fixed
2010-08-13 10:45 Paul Ishenin Note Added: 0040177
2010-08-19 08:40 Denis Golovan Status resolved => closed
2010-08-19 08:40 Denis Golovan Note Added: 0040275