mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-22 10:21:34 +01:00
* compiles again with -dnomouse
This commit is contained in:
parent
b440e794b6
commit
47ff00a141
@ -211,20 +211,27 @@ Begin
|
||||
End;
|
||||
|
||||
|
||||
Function KeyPressed:Boolean;
|
||||
{ This one doesn't care about keypresses already processed by readkey }
|
||||
{ and waiting in the KeyBuffer, only about waiting keypresses at the }
|
||||
{ TTYLevel (including ones that are waiting in the TTYRecvChar buffer) }
|
||||
function sysKeyPressed: boolean;
|
||||
var
|
||||
fdsin : fdSet;
|
||||
Begin
|
||||
if (KeySend<>KeyPut) or (InCnt>0) then
|
||||
KeyPressed:=true
|
||||
begin
|
||||
if (InCnt>0) then
|
||||
sysKeyPressed:=true
|
||||
else
|
||||
begin
|
||||
FD_Zero(fdsin);
|
||||
fd_Set(StdInputHandle,fdsin);
|
||||
Keypressed:=(Select(StdInputHandle+1,@fdsin,nil,nil,1)>0);
|
||||
sysKeypressed:=(Select(StdInputHandle+1,@fdsin,nil,nil,0)>0);
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
Function KeyPressed:Boolean;
|
||||
Begin
|
||||
Keypressed := (KeySend<>KeyPut) or sysKeyPressed;
|
||||
End;
|
||||
|
||||
Function ReadKey:char;
|
||||
Var
|
||||
@ -240,8 +247,12 @@ Begin
|
||||
exit;
|
||||
end;
|
||||
{Wait for Key}
|
||||
repeat
|
||||
until keypressed;
|
||||
if not sysKeyPressed then
|
||||
begin
|
||||
FD_Zero (fdsin);
|
||||
FD_Set (StdInputHandle,fdsin);
|
||||
Select (StdInputHandle+1,@fdsin,nil,nil,nil);
|
||||
end;
|
||||
ch:=ttyRecvChar;
|
||||
{Esc Found ?}
|
||||
If (ch=#27) then
|
||||
@ -251,7 +262,7 @@ Begin
|
||||
State:=1;
|
||||
if InCnt=0 then
|
||||
Select(StdInputHandle+1,@fdsin,nil,nil,10);
|
||||
while (State<>0) and (KeyPressed) do
|
||||
while (State<>0) and (sysKeyPressed) do
|
||||
begin
|
||||
ch:=ttyRecvChar;
|
||||
OldState:=State;
|
||||
@ -565,7 +576,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 2000-01-06 01:20:31 peter
|
||||
Revision 1.2 2000-06-30 09:00:33 jonas
|
||||
* compiles again with -dnomouse
|
||||
|
||||
Revision 1.1 2000/01/06 01:20:31 peter
|
||||
* moved out of packages/ back to topdir
|
||||
|
||||
Revision 1.1 1999/11/24 23:36:38 peter
|
||||
|
||||
@ -171,7 +171,7 @@ var
|
||||
{$endif ndef NOMOUSE}
|
||||
begin
|
||||
{$ifdef NOMOUSE}
|
||||
fillchar(@MouseEvent,SizeOf(TMouseEvent),#0);
|
||||
fillchar(MouseEvent,SizeOf(TMouseEvent),#0);
|
||||
{$else ndef NOMOUSE}
|
||||
if gpm_fd<0 then
|
||||
exit;
|
||||
@ -210,7 +210,7 @@ var
|
||||
{$endif ndef NOMOUSE}
|
||||
begin
|
||||
{$ifdef NOMOUSE}
|
||||
fillchar(@MouseEvent,SizeOf(TMouseEvent),#0);
|
||||
fillchar(MouseEvent,SizeOf(TMouseEvent),#0);
|
||||
exit(false);
|
||||
{$else ndef NOMOUSE}
|
||||
if gpm_fd<0 then
|
||||
@ -246,7 +246,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2000-04-17 08:51:38 pierre
|
||||
Revision 1.3 2000-06-30 09:00:33 jonas
|
||||
* compiles again with -dnomouse
|
||||
|
||||
Revision 1.2 2000/04/17 08:51:38 pierre
|
||||
+ set conditional NOMOUSE to get dummy mouse unit
|
||||
|
||||
Revision 1.1 2000/01/06 01:20:31 peter
|
||||
@ -278,4 +281,4 @@ end;
|
||||
Revision 1.2 1998/10/29 12:49:49 peter
|
||||
* more fixes
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user