keyboard.inc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. procedure PutKeyEvent(KeyEvent: TKeyEvent);
  12. begin
  13. PendingKeyEvent := KeyEvent;
  14. end;
  15. function GetKeyEventFlags(KeyEvent: TKeyEvent): Byte;
  16. begin
  17. GetKeyEventFlags := (KeyEvent and $FF000000) shr 24;
  18. end;
  19. function GetKeyEventChar(KeyEvent: TKeyEvent): Char;
  20. begin
  21. if KeyEvent and $03000000 = $00000000 then
  22. GetKeyEventChar := Chr(KeyEvent and $000000FF)
  23. else
  24. GetKeyEventChar := #0;
  25. end;
  26. function GetKeyEventUniCode(KeyEvent: TKeyEvent): Word;
  27. begin
  28. if KeyEvent and $03000000 = $01000000 then
  29. GetKeyEventUniCode := KeyEvent and $0000FFFF
  30. else
  31. GetKeyEventUniCode := 0;
  32. end;
  33. function GetKeyEventCode(KeyEvent: TKeyEvent): Word;
  34. begin
  35. GetKeyEventCode := KeyEvent and $0000FFFF
  36. end;
  37. function GetKeyEventShiftState(KeyEvent: TKeyEvent): Byte;
  38. begin
  39. GetKeyEventShiftState := (KeyEvent and $00FF0000) shr 16;
  40. end;
  41. function IsFunctionKey(KeyEvent: TKeyEvent): Boolean;
  42. begin
  43. IsFunctionKey := KeyEvent and $03000000 = $02000000;
  44. end;
  45. {
  46. $Log$
  47. Revision 1.1 2001-01-13 11:13:12 peter
  48. * API 2 RTL
  49. }