Hi,
You must use:
if ssCtrl in Shift then ...
instead.
That's because mouse-buttons are in Shift too. If you do Ctrl+right-click, then
Shift=[ssRight, ssCtrl]. And possibly something else (ssCaps).
V.
______________________________________________________________
Od: FreeMan <[email protected]>
Komu: Lazarus mail list <[email protected]>
Datum: 02.04.2015 13:37
Předmět: [Lazarus] how to handle Shift=[ssCtrl]
fpc r30400 lazarus r48585 yosemite qt x64
procedure TFRM_.TLabel1_MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X , Y: Integer);
begin
if(Button=mbRight)then begin
if Shift=[ssCtrl] then begin
ShowMessage('ctrl key pressed :');
end;
end;
end;
while debuging, move mouse on "Shift" and hint show values is 128,
ssCtrl values is SSCTRL. and its not aqual, I mean I can not handle ctrl
+ right click on Tlabel.
command key = 4
ssctrl =128
ssAlt = 2
ssShift = 1
ssctrl + ssAlt = 130
some shift values from hint
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus