[Lazarus] Forms.pp function error?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Forms.pp function error?

Free Pascal - Lazarus mailing list
function ShiftStateToKeys(ShiftState: TShiftState): PtrUInt;
begin
   Result := 0;
   if ssShift  in ShiftState then Result := Result or MK_SHIFT;
   if ssCtrl   in ShiftState then Result := Result or MK_CONTROL;
   if ssLeft   in ShiftState then Result := Result or MK_LBUTTON;
   if ssRight  in ShiftState then Result := Result or MK_RBUTTON;
   if ssMiddle in ShiftState then Result := Result or MK_MBUTTON;
   if ssExtra1 in ShiftState then Result := Result or MK_XBUTTON1;
   if ssExtra2 in ShiftState then Result := Result or MK_XBUTTON2;
   if ssDouble in ShiftState then Result := Result or MK_DOUBLECLICK;
   if ssTriple in ShiftState then Result := Result or MK_TRIPLECLICK;
   if ssQuad   in ShiftState then Result := Result or MK_QUADCLICK;
end;

I don't see here "if ssAlt in ...." line

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Forms.pp function error?

Free Pascal - Lazarus mailing list


On Tue, 16 Oct 2018, AlexeyT via Lazarus wrote:

> function ShiftStateToKeys(ShiftState: TShiftState): PtrUInt;
> begin
>   Result := 0;
>   if ssShift  in ShiftState then Result := Result or MK_SHIFT;
>   if ssCtrl   in ShiftState then Result := Result or MK_CONTROL;
>   if ssLeft   in ShiftState then Result := Result or MK_LBUTTON;
>   if ssRight  in ShiftState then Result := Result or MK_RBUTTON;
>   if ssMiddle in ShiftState then Result := Result or MK_MBUTTON;
>   if ssExtra1 in ShiftState then Result := Result or MK_XBUTTON1;
>   if ssExtra2 in ShiftState then Result := Result or MK_XBUTTON2;
>   if ssDouble in ShiftState then Result := Result or MK_DOUBLECLICK;
>   if ssTriple in ShiftState then Result := Result or MK_TRIPLECLICK;
>   if ssQuad   in ShiftState then Result := Result or MK_QUADCLICK;
> end;
>
> I don't see here "if ssAlt in ...." line
There does not need to be if there is no corresponding MK_nnn value ?
What would be the MK_nnn value for ssAlt ?

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Forms.pp function error?

Free Pascal - Lazarus mailing list

On 16.10.2018 09:56, Michael Van Canneyt via Lazarus wrote:
> There does not need to be if there is no corresponding MK_nnn value ?
> What would be the MK_nnn value for ssAlt ?

We can  add in, LCLType.pp:

const
   // Mouse message key states
   MK_LBUTTON  = 1;
   MK_RBUTTON = 2;
   MK_SHIFT = 4;
   MK_CONTROL = 8;
   MK_MBUTTON = $10;
   MK_XBUTTON1 = $20;
   MK_XBUTTON2 = $40;
   // following are "virtual" key states
   MK_DOUBLECLICK = $80;
   MK_TRIPLECLICK = $100;
   MK_QUADCLICK = $200;

--

Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Forms.pp function error?

Free Pascal - Lazarus mailing list


On Tue, 16 Oct 2018, AlexeyT via Lazarus wrote:

>
> On 16.10.2018 09:56, Michael Van Canneyt via Lazarus wrote:
>> There does not need to be if there is no corresponding MK_nnn value ?
>> What would be the MK_nnn value for ssAlt ?
>
> We can  add in, LCLType.pp:
>
> const
>   // Mouse message key states
>   MK_LBUTTON  = 1;
>   MK_RBUTTON = 2;
>   MK_SHIFT = 4;
>   MK_CONTROL = 8;
>   MK_MBUTTON = $10;
>   MK_XBUTTON1 = $20;
>   MK_XBUTTON2 = $40;
>   // following are "virtual" key states
>   MK_DOUBLECLICK = $80;
>   MK_TRIPLECLICK = $100;
>   MK_QUADCLICK = $200;
I understand that, but what additional value makes sense ?

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Forms.pp function error?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Value $400 makes sense.
And also this must be changed then:
function KeysToShiftState(Keys: PtrUInt): TShiftState;
it uses same constants.

Alex
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Forms.pp function error?

Free Pascal - Lazarus mailing list
On Tue, Oct 16, 2018 at 1:29 PM AlexeyT via Lazarus <[hidden email]> wrote:
Value $400 makes sense.
And also this must be changed then:
function KeysToShiftState(Keys: PtrUInt): TShiftState;
it uses same constants.

The value you're looking for is $20000000 
It's being used/supported by all current widgetsets

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus