Sign in Join
FPDoc Onlineexperiment

IsFunctionKey function

In unit keyboard

Check whether a given event is a function key event.

Declaration

pascal
function IsFunctionKey(KeyEvent: TKeyEvent): Boolean

Description

IsFunctionKey returns True if the given key event in KeyEvent was a function key or not.

Errors

None.

See also

Example: ex7

pascal
program example1;

{ This program demonstrates the GetKeyEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    If IsFunctionKey(K) then
      Writeln('Got function key : ',KeyEventToString(K))
    else
      Writeln('not a function key.');
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.