|
@@ -496,36 +496,46 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
function TDirectXConsole.NextEvent(var AEvent: TPTCEvent; AWait: Boolean; const AEventMask: TPTCEventMask): Boolean;
|
|
function TDirectXConsole.NextEvent(var AEvent: TPTCEvent; AWait: Boolean; const AEventMask: TPTCEventMask): Boolean;
|
|
|
|
+var
|
|
|
|
+ UseGetMessage: Boolean;
|
|
begin
|
|
begin
|
|
CHECK_OPEN('TDirectXConsole.NextEvent');
|
|
CHECK_OPEN('TDirectXConsole.NextEvent');
|
|
// CHECK_LOCK('TDirectXConsole.NextEvent');
|
|
// CHECK_LOCK('TDirectXConsole.NextEvent');
|
|
|
|
|
|
FreeAndNil(AEvent);
|
|
FreeAndNil(AEvent);
|
|
|
|
+ UseGetMessage := False;
|
|
repeat
|
|
repeat
|
|
FPrimary.Block;
|
|
FPrimary.Block;
|
|
|
|
|
|
{ update window }
|
|
{ update window }
|
|
- FWindow.Update;
|
|
|
|
|
|
+ FWindow.Update(False, UseGetMessage);
|
|
|
|
|
|
{ try to find an event that matches the EventMask }
|
|
{ try to find an event that matches the EventMask }
|
|
AEvent := FEventQueue.NextEvent(AEventMask);
|
|
AEvent := FEventQueue.NextEvent(AEventMask);
|
|
|
|
+ if AWait then
|
|
|
|
+ UseGetMessage := True;
|
|
until (not AWait) or (AEvent <> nil);
|
|
until (not AWait) or (AEvent <> nil);
|
|
Result := AEvent <> nil;
|
|
Result := AEvent <> nil;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TDirectXConsole.PeekEvent(AWait: Boolean; const AEventMask: TPTCEventMask): TPTCEvent;
|
|
function TDirectXConsole.PeekEvent(AWait: Boolean; const AEventMask: TPTCEventMask): TPTCEvent;
|
|
|
|
+var
|
|
|
|
+ UseGetMessage: Boolean;
|
|
begin
|
|
begin
|
|
CHECK_OPEN('TDirectXConsole.PeekEvent');
|
|
CHECK_OPEN('TDirectXConsole.PeekEvent');
|
|
// CHECK_LOCK('TDirectXConsole.PeekEvent');
|
|
// CHECK_LOCK('TDirectXConsole.PeekEvent');
|
|
|
|
|
|
|
|
+ UseGetMessage := False;
|
|
repeat
|
|
repeat
|
|
FPrimary.Block;
|
|
FPrimary.Block;
|
|
|
|
|
|
{ update window }
|
|
{ update window }
|
|
- FWindow.Update;
|
|
|
|
|
|
+ FWindow.Update(False, UseGetMessage);
|
|
|
|
|
|
{ try to find an event that matches the EventMask }
|
|
{ try to find an event that matches the EventMask }
|
|
Result := FEventQueue.PeekEvent(AEventMask);
|
|
Result := FEventQueue.PeekEvent(AEventMask);
|
|
|
|
+ if AWait then
|
|
|
|
+ UseGetMessage := True;
|
|
until (not AWait) or (Result <> nil);
|
|
until (not AWait) or (Result <> nil);
|
|
end;
|
|
end;
|
|
|
|
|