[Overview][Constants][Types][Procedures and functions][Index] |
Put a key event in the event queue.
Source position: keybrdh.inc line 151
procedure PutKeyEvent( |
KeyEvent: TKeyEvent |
); |
PutKeyEvent adds the given KeyEvent to the input queue. Please note that depending on the implementation this can hold only one value, i.e. when calling PutKeyEvent multiple times, only the last pushed key will be remembered.
None
|
Get next key event, but does not wait. |
|
|
Get the next raw key event, wait if needed. |
program example5; { This program demonstrates the PutKeyEvent function } uses keyboard; Var K,k2 : TKeyEvent; begin InitKeyBoard; Writeln('Press keys, press "q" to end.'); K2:=0; Repeat K:=GetKeyEvent; If k<>0 then begin if (k2 mod 2)=0 then K2:=K+1 else K2:=0; K:=TranslateKeyEvent(K); Writeln('Got key : ',KeyEventToString(K)); if (K2<>0) then begin PutKeyEvent(k2); K2:=TranslateKeyEVent(K2); Writeln('Put key : ',KeyEventToString(K2)) end end Until (GetKeyEventChar(K)='q'); DoneKeyBoard; end.