program Project1;{$mode objfpc}{$H+}uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes,keyboard { you can add units after this };{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}Var K : TKeyEvent;begin InitKeyBoard; Writeln('Press keys, press "q" to end.'); Repeat K:=PollKeyEvent; If k<>0 then begin K:=GetKeyEvent; K:=TranslateKeyEvent(K); writeln; Writeln('Got key : ',KeyEventToString(K)); end else write('.'); Until (GetKeyEventChar(K)='q'); DoneKeyBoard;end.
Works fine here (Kubuntu 10.10, FPC 2.5.1 about 2 weeks ago)
Hi did you make it same way - 2nd option Program (not console). It could be my compiler, but its unlikely. More than likely my settings are amiss.