help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions] Reference for unit 'keyboard' (#rtl)

GetKeyEventCode

Translate function key part of a key event code.

Declaration

Source position: keybrdh.inc line 174

function GetKeyEventCode(

  KeyEvent: TKeyEvent

):Word;

Description

GetKeyEventCode returns the translated function keycode part of the given KeyEvent, if it contains a translated function key.

If the key pressed was not a function key, the null character is returned.

Errors

None.

See also

GetKeyEventUniCode

  

Return the unicode key event.

GetKeyEventShiftState

  

Return the current state of the shift keys.

GetKeyEventFlags

  

Extract the flags from a key event.

GetKeyEventChar

  

Get the character key part of a key event.

GetKeyEvent

  

Get the next raw key event, wait if needed.

Example

Program Example2;

{ Program to demonstrate the GetKeyEventCode function. }

Uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press function keys, or press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    If (GetKeyEventFlags(K)<>KbfnKey) then
      Writeln('Not a function key')
    else
      begin
      Write('Got key (',GetKeyEventCode(K));
      Writeln(') : ',KeyEventToString(K));
      end;
  Until (GetKeyEventChar(K)='q');
  DoneKeyboard;
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505