Mousewheel event only when rolling down, not when rolling up
Original Reporter info from Mantis: crlab @neurolabusc1
-
Reporter name: Chris Rorden
Original Reporter info from Mantis: crlab @neurolabusc1
- Reporter name: Chris Rorden
Description:
Hello -
I am not sure if this is a bug, or I am simply not implementing the mousewheel response correctly. I want a form to respond when the user rolls his mousewheel up or down. The following code responds to a down roll, but does not get invoked for an upwards roll of the mousewheel (I am using Lazarus 0.9.14 on Windows XP). The downwards correctly roll reports an event with a negative WheelDelta, but the upwards movement is completely ignored. I know my mouse works fine, as I can use the mousewheel to scroll up or down in the Lazarus IDE and other programs. Any thoughts?
Steps to reproduce:
unit MainUnit1;
interface
uses
Classes, SysUtils, LCLType, LResources, Forms, Controls, Graphics, Dialogs,
Buttons, StdCtrls, ExtCtrls,ClipBrd,ComCtrls;
{ TForm1 }
type
TForm1 = class(TForm)
private
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;MousePos: TPoint): Boolean; override;
published
property OnMouseWheel;
end;
var
Form1: TForm1;
implementation
{ TForm1 }
function TForm1.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
MousePos: TPoint): Boolean;
begin
//... actions prior to a possible OnMouseWheel[Down|Up]
Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos);
//... actions after a possible OnMouseWheel[Down|Up]
Form1.Caption := inttostr(WheelDelta)+' '+inttostr(random(888))+' '+inttostr(MousePos.X);
end;
Mantis conversion info:
- Mantis ID: 2006
- OS: Windows
- OS Build: XP
- Platform: x86
- Version: 0.9.14
- Fixed in version: 0.9.15 (SVN)
- Fixed in revision: 9210 (#0fd39df1)
- Target version: 1.0.0
- LazTarget: 1.0