How to receive information about pressing/releasing a key on the keyboard? My code is:
type
{$PACKRECORDS C}
TRawKeyInfo = record
TimeStamp : Int64;
KeyCode : DWord;
IsKeyDown : Boolean;
end;
const
KB_READ = 9999;
var
fd:LongInt;
S:TRawKeyInfo;
begin
fd:=fpopen(’/dev/input/keyboard/at/0’,O_RDWR);
if fd>=0 then
repeat
IoCtl(fd,KB_READ,@S);
WriteLn(S.TimeStamp,’ ‘,S.IsKeyDown,’ ',S.KeyCode)
until False;
end.