[Lazarus] Shift returns empty set in MouseWheel events
Vojtěch Čihák
vojtech.cihak at atlas.cz
Wed Jul 27 14:36:11 CEST 2016
Hi,
IMO it is correct. OnMouseWheelxxx are events for rolling the mouse wheel, therefore the ssMiddle cannot be in Shift.
If you need to detect if Middle button is pressed, use OnMouseDown/OnMouseUp and test "if Mouse=mbMiddle then ..."
Also, ssMiddle appears in Shift in OnMouseDown/OnMouseUp.
V.
______________________________________________________________
> Od: Wolf <wv99999 at gmail.com>
> Komu: lazarus at lists.lazarus-ide.org
> Datum: 27.07.2016 11:39
> Předmět: [Lazarus] Shift returns empty set in MouseWheel events
>
For any of these MouseWheel handlers
procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure TForm1.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
the variable Shift: TShiftState returns an empty set.
Is that intentional, or is that a bug? If intentional, how can I
restrict the MouseWheel event to
<WheelPressed>? Other mouse events, such as
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
return ssMiddle as a member of the TShiftState set when the MouseWheel
is pressed and
can be tested for using
if ssMiddle in Shift then . . .
How can I determine whether the MouseWheel was pressed or not?
My operating system: Kubuntu 16.04
Lazarus version: 1.6+dfsg-1 dated 2016-03-01
FPC Version: 3.0.0
SVN revision: Debian Package 1.6+dfsg-1
x86_64-linux-qt
Thank you
Wolf
--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus <http://lists.lazarus-ide.org/listinfo/lazarus>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160727/0fc8cfab/attachment.html>
More information about the Lazarus
mailing list