mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 04:18:31 +02:00
No mouse up events for mouse wheel.
This commit is contained in:
parent
0ce9845809
commit
89af29c27f
@ -130,8 +130,9 @@ begin
|
||||
begin
|
||||
if (LastMouseEvent.Buttons=0) then
|
||||
MouseEvent.Action:=MouseActionDown
|
||||
else
|
||||
MouseEvent.Action:=MouseActionUp;
|
||||
else { MouseButton4 or MouseButton5 has no Up event, weed them out }
|
||||
if ((LastMouseEvent.Buttons and (MouseButton4 or MouseButton5)) = 0) then
|
||||
MouseEvent.Action:=MouseActionUp;
|
||||
end;
|
||||
LastMouseEvent:=MouseEvent;
|
||||
end;
|
||||
|
@ -503,11 +503,12 @@ const
|
||||
Action : 0;
|
||||
);
|
||||
|
||||
procedure GenFakeReleaseEvent(MouseEvent : TMouseEvent);
|
||||
procedure GenFakeReleaseEvent(var MouseEvent : TMouseEvent);
|
||||
begin
|
||||
MouseEvent.action := MouseActionUp;
|
||||
MouseEvent.buttons := 0;
|
||||
PutMouseEvent(MouseEvent);
|
||||
{ fake event is to decive LastMouseEvent
|
||||
PutMouseEvent(MouseEvent); do not make real event }
|
||||
end;
|
||||
|
||||
procedure GenMouseEvent;
|
||||
@ -650,10 +651,13 @@ const
|
||||
end;
|
||||
*)
|
||||
PutMouseEvent(MouseEvent);
|
||||
if (MouseEvent.buttons and (8+16)) <> 0 then // 'M' escape sequence cannot map button 4&5 release, so fake one.
|
||||
if (MouseEvent.buttons and (MouseButton4 or MouseButton5)) <> 0 then
|
||||
GenFakeReleaseEvent(MouseEvent);
|
||||
if NeedMouseRelease then
|
||||
begin
|
||||
GenFakeReleaseEvent(MouseEvent);
|
||||
PutMouseEvent(MouseEvent); {rxvt bug, need real event here as workaround }
|
||||
end;
|
||||
{$ifdef DebugMouse}
|
||||
if MouseEvent.Action=MouseActionDown then
|
||||
Write(system.stderr,'Button down : ')
|
||||
@ -776,11 +780,11 @@ const
|
||||
end;
|
||||
end;
|
||||
PutMouseEvent(MouseEvent);
|
||||
if (ButtonMask and (8+16)) <> 0 then // 'M' escape sequence cannot map button 4&5 release, so fake one.
|
||||
if (ButtonMask and (MouseButton4 or MouseButton5)) <> 0 then
|
||||
begin
|
||||
MouseEvent.Action:=MouseActionUp;
|
||||
MouseEvent.Action:=MouseActionUp; {to trick LastMouseEvent pretend that we have MouseActionUp event }
|
||||
MouseEvent.Buttons:=LastMouseEvent.Buttons and not ButtonMask;
|
||||
PutMouseEvent(MouseEvent);
|
||||
{PutMouseEvent(MouseEvent); do not put actual event }
|
||||
end;
|
||||
LastMouseEvent:=MouseEvent;
|
||||
end;
|
||||
|
@ -104,6 +104,7 @@ procedure MouseEventHandler(var ir:INPUT_RECORD);
|
||||
e.buttons := e.buttons and not (MouseButton4 or MouseButton5);
|
||||
e.Action := MouseActionUp;
|
||||
LastHandlermouseEvent:=e;
|
||||
{ do not put actual event (fake it just for LastHandlermouseEvent)
|
||||
while PendingMouseEvents>=MouseEventBufSize do
|
||||
begin
|
||||
LeaveCriticalSection(ChangeMouseEvents);
|
||||
@ -111,6 +112,7 @@ procedure MouseEventHandler(var ir:INPUT_RECORD);
|
||||
EnterCriticalSection(ChangeMouseEvents);
|
||||
end;
|
||||
PutMouseEvent(e);
|
||||
}
|
||||
end;
|
||||
end;
|
||||
// this should be done in PutMouseEvent, now it is PM
|
||||
|
Loading…
Reference in New Issue
Block a user