mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 14:09:06 +02:00
* give up timeslices while waiting in SysGetMouseEvent, compilation fix plus change of pointer conversion to unsigned
git-svn-id: trunk@7937 -
This commit is contained in:
parent
bbf7c50479
commit
581515d8e5
@ -740,6 +740,8 @@ const
|
|||||||
LastCallcounter : longint = 0;
|
LastCallcounter : longint = 0;
|
||||||
|
|
||||||
procedure SysGetMouseEvent(var MouseEvent: TMouseEvent);
|
procedure SysGetMouseEvent(var MouseEvent: TMouseEvent);
|
||||||
|
var
|
||||||
|
RR: TRealRegs;
|
||||||
begin
|
begin
|
||||||
if not MousePresent then
|
if not MousePresent then
|
||||||
begin
|
begin
|
||||||
@ -754,11 +756,15 @@ begin
|
|||||||
{$endif EXTMOUSEDEBUG}
|
{$endif EXTMOUSEDEBUG}
|
||||||
LastCallcounter:=Callcounter;
|
LastCallcounter:=Callcounter;
|
||||||
{$endif DEBUG}
|
{$endif DEBUG}
|
||||||
repeat until PendingMouseEvents>0;
|
while PendingMouseEvents = 0 do
|
||||||
|
begin
|
||||||
|
(* Give up time slices while waiting for mouse events. *)
|
||||||
|
RealIntr ($28, RR);
|
||||||
|
end;
|
||||||
MouseEvent:=PendingMouseHead^;
|
MouseEvent:=PendingMouseHead^;
|
||||||
inc(PendingMouseHead);
|
inc(PendingMouseHead);
|
||||||
if longint(PendingMouseHead)=longint(@PendingMouseEvent)+sizeof(PendingMouseEvent) then
|
if ptruint(PendingMouseHead)=ptruint(@PendingMouseEvent)+sizeof(PendingMouseEvent) then
|
||||||
PendingMouseHead:=@PendingMouseEvent;
|
PendingMouseHead:=PMouseEvent(@PendingMouseEvent);
|
||||||
dec(PendingMouseEvents);
|
dec(PendingMouseEvents);
|
||||||
if (LastMouseEvent.x<>MouseEvent.x) or (LastMouseEvent.y<>MouseEvent.y) then
|
if (LastMouseEvent.x<>MouseEvent.x) or (LastMouseEvent.y<>MouseEvent.y) then
|
||||||
MouseEvent.Action:=MouseActionMove;
|
MouseEvent.Action:=MouseActionMove;
|
||||||
|
Loading…
Reference in New Issue
Block a user