[Lazarus] IDE: Win32: MouseWheel Scrolling (SynEdit)
Martin Friebe
lazarus at mfriebe.de
Mon Oct 27 22:24:57 CET 2008
Christian Budde wrote:
> Hi Martin
>
>> This is probably cross all OS. I am not sure what the intended
>> behaviour is.
>>
>> I guess that it is correct to take the action on Mouse-up, but it may be
>> sensible to limit it on cases where ctrl was hold down during the
>> mouse-down event. IMHO in that case, you could either say:
>> - if ctrl was down during mouse-down, then mouse-up should trigger the
>> jump, independent of ctrl still being pressed or not
>> - if ctrl was down during mouse-down, then mouse-up will jump, if ctrl
>> is still pressed, and was not released in between.
>> But maybe it can/should be done on MouseDown, but I don't know what
>> opuld happen, if you end up in the new unit, with the mouse button still
>> down?
>>
>> Maybe others have ideas too, also you may wish to discuss this with the
>> Lazarus team them self, if such a change would be accepted. Mattias
>> would be probably be a good contact for this. Maybe he will pick up on
>> this mail?
>>
>> Implementing any change to this, should be straight forward, as all
>> Mouse/Key-Up/Down handlers are in synedit.pp
>> Search for "CtrlMouse" and look at SynEditMarkupCtrlMouseLink.pp
>> (responsible for the underlining of the link), that should point you to
>> all other places of interest.
>>
> I just had a look for the 'CtrlMouse' thing and found that the source
> code is already correct (basically). The only thing that seems to be
> wrong is that the GetKeyShiftState doesn't contain any info about the
> mouse buttons.
> So 'ssLeft in GetKeyShiftState' is always false. Thus the query for
> GetKeyShiftState to distinguish, whether the mouse is pressed or not
> fail and so the whole thing got triggered wrong.
>
> Is this a known issue (or even feature?) of the LCL?
>
I don't know what the intended behaviour is, but I assume not to much
thought was spend on it.
I don't know if anyone else noticed, or had an issue with it.
In order to archive your target, you could probably make the assignment
of fLastControlIsPressed dependent on left-mouse not pressed.
Or maybe make just the inclusion of SYNEDIT_LINK_MODIFIER depended,
while exclusion of the flag works always (or you get a sticky ctrl key,
once the mouse is down)
=> so ctrl-up will be recognized, even while the left-mouse is down. But
ctrl-down will only be remembered, while the mouse is still unpressed.
Afaik your options on it are:
- discuss it here, get Mattias or a Lazarus' Team members opinion.
- Report it as a bug, (with or without Patch, you can get the patch in
later if you like). That way you will definitely get an answer if your
intended behaviour is acceptable or not
Imho, I think your change request does sounds acceptable.
Martin
More information about the Lazarus
mailing list