keyeventd.inc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {
  2. Free Pascal port of the OpenPTC C++ library.
  3. Copyright (C) 2001-2003 Nikolay Nikolov ([email protected])
  4. Original C++ version by Glenn Fiedler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. }
  17. Type
  18. TPTCKeyEvent=Class(TPTCEvent)
  19. Private
  20. FCode : Integer;
  21. FUnicode : Integer;
  22. FAlt : Boolean;
  23. FShift : Boolean;
  24. FControl : Boolean;
  25. FPress : Boolean;
  26. Function GetRelease : Boolean;
  27. Protected
  28. Function GetType : TPTCEventType; Override;
  29. Public
  30. Constructor Create;
  31. Constructor Create(ACode : Integer);
  32. Constructor Create(ACode, AUnicode : Integer);
  33. Constructor Create(ACode, AUnicode : Integer; APress : Boolean);
  34. Constructor Create(ACode : Integer; AAlt, AShift, AControl : Boolean);
  35. Constructor Create(ACode : Integer; AAlt, AShift, AControl, APress : Boolean);
  36. Constructor Create(ACode, AUnicode : Integer;
  37. AAlt, AShift, AControl : Boolean);
  38. Constructor Create(ACode, AUnicode : Integer;
  39. AAlt, AShift, AControl, APress : Boolean);
  40. Constructor Create(Const AKey : TPTCKeyEvent);
  41. Procedure Assign(Const AKey : TPTCKeyEvent);
  42. Function Equals(Const AKey : TPTCKeyEvent) : Boolean;
  43. Property Code : Integer read FCode;
  44. Property Unicode : Integer read FUnicode;
  45. Property Alt : Boolean read FAlt;
  46. Property Shift : Boolean read FShift;
  47. Property Control : Boolean read FControl;
  48. Property Press : Boolean read FPress;
  49. Property Release : Boolean read GetRelease;
  50. End;
  51. Const
  52. PTCKEY_UNDEFINED = $00;
  53. PTCKEY_CANCEL = $03;
  54. PTCKEY_BACKSPACE = $08; {'\b'}
  55. PTCKEY_TAB = $09; {'\t'}
  56. PTCKEY_ENTER = $0A; {'\n'}
  57. PTCKEY_CLEAR = $0C;
  58. PTCKEY_SHIFT = $10;
  59. PTCKEY_CONTROL = $11;
  60. PTCKEY_ALT = $12;
  61. PTCKEY_PAUSE = $13;
  62. PTCKEY_CAPSLOCK = $14;
  63. PTCKEY_KANA = $15;
  64. PTCKEY_FINAL = $18;
  65. PTCKEY_KANJI = $19;
  66. PTCKEY_ESCAPE = $1B;
  67. PTCKEY_CONVERT = $1C;
  68. PTCKEY_NONCONVERT = $1D;
  69. PTCKEY_ACCEPT = $1E;
  70. PTCKEY_MODECHANGE = $1F;
  71. PTCKEY_SPACE = $20;
  72. PTCKEY_PAGEUP = $21;
  73. PTCKEY_PAGEDOWN = $22;
  74. PTCKEY_END = $23;
  75. PTCKEY_HOME = $24;
  76. PTCKEY_LEFT = $25;
  77. PTCKEY_UP = $26;
  78. PTCKEY_RIGHT = $27;
  79. PTCKEY_DOWN = $28;
  80. PTCKEY_COMMA = $2C; {','}
  81. PTCKEY_PERIOD = $2E; {'.'}
  82. PTCKEY_SLASH = $2F; {'/'}
  83. PTCKEY_ZERO = $30;
  84. PTCKEY_ONE = $31;
  85. PTCKEY_TWO = $32;
  86. PTCKEY_THREE = $33;
  87. PTCKEY_FOUR = $34;
  88. PTCKEY_FIVE = $35;
  89. PTCKEY_SIX = $36;
  90. PTCKEY_SEVEN = $37;
  91. PTCKEY_EIGHT = $38;
  92. PTCKEY_NINE = $39;
  93. PTCKEY_SEMICOLON = $3B; {';'}
  94. PTCKEY_EQUALS = $3D; {'='}
  95. PTCKEY_A = $41;
  96. PTCKEY_B = $42;
  97. PTCKEY_C = $43;
  98. PTCKEY_D = $44;
  99. PTCKEY_E = $45;
  100. PTCKEY_F = $46;
  101. PTCKEY_G = $47;
  102. PTCKEY_H = $48;
  103. PTCKEY_I = $49;
  104. PTCKEY_J = $4A;
  105. PTCKEY_K = $4B;
  106. PTCKEY_L = $4C;
  107. PTCKEY_M = $4D;
  108. PTCKEY_N = $4E;
  109. PTCKEY_O = $4F;
  110. PTCKEY_P = $50;
  111. PTCKEY_Q = $51;
  112. PTCKEY_R = $52;
  113. PTCKEY_S = $53;
  114. PTCKEY_T = $54;
  115. PTCKEY_U = $55;
  116. PTCKEY_V = $56;
  117. PTCKEY_W = $57;
  118. PTCKEY_X = $58;
  119. PTCKEY_Y = $59;
  120. PTCKEY_Z = $5A;
  121. PTCKEY_OPENBRACKET = $5B; {'['}
  122. PTCKEY_BACKSLASH = $5C; {'\'}
  123. PTCKEY_CLOSEBRACKET = $5D; {']'}
  124. PTCKEY_NUMPAD0 = $60;
  125. PTCKEY_NUMPAD1 = $61;
  126. PTCKEY_NUMPAD2 = $62;
  127. PTCKEY_NUMPAD3 = $63;
  128. PTCKEY_NUMPAD4 = $64;
  129. PTCKEY_NUMPAD5 = $65;
  130. PTCKEY_NUMPAD6 = $66;
  131. PTCKEY_NUMPAD7 = $67;
  132. PTCKEY_NUMPAD8 = $68;
  133. PTCKEY_NUMPAD9 = $69;
  134. PTCKEY_MULTIPLY = $6A; {numpad '*'}
  135. PTCKEY_ADD = $6B; {numpad '+'}
  136. PTCKEY_SEPARATOR = $6C;
  137. PTCKEY_SUBTRACT = $6D; {numpad '-'}
  138. PTCKEY_DECIMAL = $6E; {numpad '.'}
  139. PTCKEY_DIVIDE = $6F; {numpad '/'}
  140. PTCKEY_F1 = $70;
  141. PTCKEY_F2 = $71;
  142. PTCKEY_F3 = $72;
  143. PTCKEY_F4 = $73;
  144. PTCKEY_F5 = $74;
  145. PTCKEY_F6 = $75;
  146. PTCKEY_F7 = $76;
  147. PTCKEY_F8 = $77;
  148. PTCKEY_F9 = $78;
  149. PTCKEY_F10 = $79;
  150. PTCKEY_F11 = $7A;
  151. PTCKEY_F12 = $7B;
  152. PTCKEY_DELETE = $7F;
  153. PTCKEY_NUMLOCK = $90;
  154. PTCKEY_SCROLLLOCK = $91;
  155. PTCKEY_PRINTSCREEN = $9A;
  156. PTCKEY_INSERT = $9B;
  157. PTCKEY_HELP = $9C;
  158. PTCKEY_META = $9D;
  159. PTCKEY_BACKQUOTE = $C0;
  160. PTCKEY_QUOTE = $DE;