ex6.pp 515 B

123456789101112131415161718192021222324252627
  1. program example6;
  2. { This program demonstrates the PollShiftStateEvent function }
  3. uses keyboard;
  4. Var
  5. K : TKeyEvent;
  6. begin
  7. InitKeyBoard;
  8. Writeln('Press keys, press "q" to end.');
  9. Repeat
  10. K:=PollKeyEvent;
  11. If k<>0 then
  12. begin
  13. K:=PollShiftStateEvent;
  14. Writeln('Got shift state : ',ShiftStateToString(K,False));
  15. // Consume the key.
  16. K:=GetKeyEvent;
  17. K:=TranslateKeyEvent(K);
  18. end
  19. { else
  20. write('.')};
  21. Until (GetKeyEventChar(K)='q');
  22. DoneKeyBoard;
  23. end.