Return the current state of the shift keys.
Source position: keybrdh.inc line 273
function GetKeyEventShiftState( |
KeyEvent: TKeyEvent |
):Byte; |
GetKeyEventShiftState returns the shift-state values of the given KeyEvent. This can be used to detect which of the modifier keys Shift, Alt or Ctrl were pressed. If none were pressed, zero is returned.
Note that this function does not always return expected results; In a UNIX X-Term, the modifier keys do not always work.
None.
|
Return the Unicode key event. |
|
|
Extract the flags from a key event. |
|
|
Translate function key part of a key event code. |
|
|
Get the character key part of a key event. |
|
|
Get the next raw key event, wait if needed. |
Program Example3; { Program to demonstrate the GetKeyEventShiftState function. } Uses keyboard; Var K : TKeyEvent; S : Byte; begin InitKeyBoard; Write('Press keys combined with CTRL/SHIFT/ALT'); Writeln(', or press "q" to end.'); Repeat K:=GetKeyEvent; K:=TranslateKeyEvent(K); S:=GetKeyEventShiftState(K); If (S=0) then Writeln('No special keys pressed') else begin Writeln('Detected special keys : ',ShiftStateToString(K,False)); Writeln('Got key : ',KeyEventToString(K)); end; Until (GetKeyEventChar(K)='q'); DoneKeyboard; end.