[Overview][Constants][Types][Procedures and functions][Index] |
Get next key event, but does not wait.
Source position: keybrdh.inc line 150
function PollKeyEvent: TKeyEvent; |
PollKeyEvent checks whether a key event is available, and returns it if one is found. If no event is pending, it returns 0.
Note that this does not remove the key from the pending keys. The key should still be retrieved from the pending key events list with the GetKeyEvent function.
None.
|
Put a key event in the event queue. |
|
|
Get the next raw key event, wait if needed. |
program example4; { This program demonstrates the PollKeyEvent function } uses keyboard; 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.
lazarus-ccr.sourceforge.net |