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



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

PollShiftStateEvent

Check current shift state.

Declaration

Source position: keybrdh.inc line 154

function PollShiftStateEvent: TKeyEvent;

Description

PollShiftStateEvent returns the current shiftstate in a keyevent. This will return 0 if there is no key event pending.

Errors

None.

See also

PollKeyEvent

  

Get next key event, but does not wait.

GetKeyEvent

  

Get the next raw key event, wait if needed.

Example

program example6;

{ This program demonstrates the PollShiftStateEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=PollKeyEvent;
    If k<>0 then
      begin
      K:=PollShiftStateEvent;
      Writeln('Got shift state : ',ShiftStateToString(K,False));
      // Consume the key.
      K:=GetKeyEvent;
      K:=TranslateKeyEvent(K);
      end
{    else
      write('.')};
  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