/packages/ptc/src/core/keyeventd.inc
Pascal | 180 lines | 143 code | 5 blank | 32 comment | 0 complexity | a173a247b471acd50d9a593b6aee83ed MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
1{ 2 Free Pascal port of the OpenPTC C++ library. 3 Copyright (C) 2001-2003, 2006, 2007, 2009-2011 Nikolay Nikolov (nickysn@users.sourceforge.net) 4 Original C++ version by Glenn Fiedler (ptc@gaffer.org) 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License as published by the Free Software Foundation; either 9 version 2.1 of the License, or (at your option) any later version 10 with the following modification: 11 12 As a special exception, the copyright holders of this library give you 13 permission to link this library with independent modules to produce an 14 executable, regardless of the license terms of these independent modules,and 15 to copy and distribute the resulting executable under terms of your choice, 16 provided that you also meet, for each linked independent module, the terms 17 and conditions of the license of that module. An independent module is a 18 module which is not derived from or based on this library. If you modify 19 this library, you may extend this exception to your version of the library, 20 but you are not obligated to do so. If you do not wish to do so, delete this 21 exception statement from your version. 22 23 This library is distributed in the hope that it will be useful, 24 but WITHOUT ANY WARRANTY; without even the implied warranty of 25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 Lesser General Public License for more details. 27 28 You should have received a copy of the GNU Lesser General Public 29 License along with this library; if not, write to the Free Software 30 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 31} 32 33type 34 IPTCKeyEvent = interface(IPTCEvent) 35 ['{9BD1CD41-1DF6-4392-99DC-885EADB6D85A}'] 36 function GetCode: Integer; 37 function GetUnicode: Integer; 38 function GetAlt: Boolean; 39 function GetShift: Boolean; 40 function GetControl: Boolean; 41 function GetPress: Boolean; 42 function GetRelease: Boolean; 43 44// function Equals(AKey: IPTCKeyEvent): Boolean; 45 46 property Code: Integer read GetCode; 47 property Unicode: Integer read GetUnicode; 48 property Alt: Boolean read GetAlt; 49 property Shift: Boolean read GetShift; 50 property Control: Boolean read GetControl; 51 property Press: Boolean read GetPress; 52 property Release: Boolean read GetRelease; 53 end; 54 55 TPTCKeyEventFactory = class 56 public 57 class function CreateNew: IPTCKeyEvent; 58 class function CreateNew(ACode: Integer): IPTCKeyEvent; 59 class function CreateNew(ACode, AUnicode: Integer): IPTCKeyEvent; 60 class function CreateNew(ACode, AUnicode: Integer; APress: Boolean): IPTCKeyEvent; 61 class function CreateNew(ACode: Integer; AAlt, AShift, AControl: Boolean): IPTCKeyEvent; 62 class function CreateNew(ACode: Integer; AAlt, AShift, AControl, APress: Boolean): IPTCKeyEvent; 63 class function CreateNew(ACode, AUnicode: Integer; 64 AAlt, AShift, AControl: Boolean): IPTCKeyEvent; 65 class function CreateNew(ACode, AUnicode: Integer; 66 AAlt, AShift, AControl, APress: Boolean): IPTCKeyEvent; 67 class function CreateNew(AKey: IPTCKeyEvent): IPTCKeyEvent; 68 end; 69 70const 71 PTCKEY_UNDEFINED = $00; 72 PTCKEY_CANCEL = $03; 73 PTCKEY_BACKSPACE = $08; {'\b'} 74 PTCKEY_TAB = $09; {'\t'} 75 PTCKEY_ENTER = $0A; {'\n'} 76 PTCKEY_CLEAR = $0C; 77 PTCKEY_SHIFT = $10; 78 PTCKEY_CONTROL = $11; 79 PTCKEY_ALT = $12; 80 PTCKEY_PAUSE = $13; 81 PTCKEY_CAPSLOCK = $14; 82 PTCKEY_KANA = $15; 83 PTCKEY_FINAL = $18; 84 PTCKEY_KANJI = $19; 85 PTCKEY_ESCAPE = $1B; 86 PTCKEY_CONVERT = $1C; 87 PTCKEY_NONCONVERT = $1D; 88 PTCKEY_ACCEPT = $1E; 89 PTCKEY_MODECHANGE = $1F; 90 PTCKEY_SPACE = $20; 91 PTCKEY_PAGEUP = $21; 92 PTCKEY_PAGEDOWN = $22; 93 PTCKEY_END = $23; 94 PTCKEY_HOME = $24; 95 PTCKEY_LEFT = $25; 96 PTCKEY_UP = $26; 97 PTCKEY_RIGHT = $27; 98 PTCKEY_DOWN = $28; 99 PTCKEY_COMMA = $2C; {','} 100 PTCKEY_PERIOD = $2E; {'.'} 101 PTCKEY_SLASH = $2F; {'/'} 102 PTCKEY_ZERO = $30; 103 PTCKEY_ONE = $31; 104 PTCKEY_TWO = $32; 105 PTCKEY_THREE = $33; 106 PTCKEY_FOUR = $34; 107 PTCKEY_FIVE = $35; 108 PTCKEY_SIX = $36; 109 PTCKEY_SEVEN = $37; 110 PTCKEY_EIGHT = $38; 111 PTCKEY_NINE = $39; 112 PTCKEY_SEMICOLON = $3B; {';'} 113 PTCKEY_EQUALS = $3D; {'='} 114 PTCKEY_A = $41; 115 PTCKEY_B = $42; 116 PTCKEY_C = $43; 117 PTCKEY_D = $44; 118 PTCKEY_E = $45; 119 PTCKEY_F = $46; 120 PTCKEY_G = $47; 121 PTCKEY_H = $48; 122 PTCKEY_I = $49; 123 PTCKEY_J = $4A; 124 PTCKEY_K = $4B; 125 PTCKEY_L = $4C; 126 PTCKEY_M = $4D; 127 PTCKEY_N = $4E; 128 PTCKEY_O = $4F; 129 PTCKEY_P = $50; 130 PTCKEY_Q = $51; 131 PTCKEY_R = $52; 132 PTCKEY_S = $53; 133 PTCKEY_T = $54; 134 PTCKEY_U = $55; 135 PTCKEY_V = $56; 136 PTCKEY_W = $57; 137 PTCKEY_X = $58; 138 PTCKEY_Y = $59; 139 PTCKEY_Z = $5A; 140 PTCKEY_OPENBRACKET = $5B; {'['} 141 PTCKEY_BACKSLASH = $5C; {'\'} 142 PTCKEY_CLOSEBRACKET = $5D; {']'} 143 PTCKEY_NUMPAD0 = $60; 144 PTCKEY_NUMPAD1 = $61; 145 PTCKEY_NUMPAD2 = $62; 146 PTCKEY_NUMPAD3 = $63; 147 PTCKEY_NUMPAD4 = $64; 148 PTCKEY_NUMPAD5 = $65; 149 PTCKEY_NUMPAD6 = $66; 150 PTCKEY_NUMPAD7 = $67; 151 PTCKEY_NUMPAD8 = $68; 152 PTCKEY_NUMPAD9 = $69; 153 PTCKEY_MULTIPLY = $6A; {numpad '*'} 154 PTCKEY_ADD = $6B; {numpad '+'} 155 PTCKEY_SEPARATOR = $6C; 156 PTCKEY_SUBTRACT = $6D; {numpad '-'} 157 PTCKEY_DECIMAL = $6E; {numpad '.'} 158 PTCKEY_DIVIDE = $6F; {numpad '/'} 159 PTCKEY_F1 = $70; 160 PTCKEY_F2 = $71; 161 PTCKEY_F3 = $72; 162 PTCKEY_F4 = $73; 163 PTCKEY_F5 = $74; 164 PTCKEY_F6 = $75; 165 PTCKEY_F7 = $76; 166 PTCKEY_F8 = $77; 167 PTCKEY_F9 = $78; 168 PTCKEY_F10 = $79; 169 PTCKEY_F11 = $7A; 170 PTCKEY_F12 = $7B; 171 PTCKEY_DELETE = $7F; 172 PTCKEY_NUMLOCK = $90; 173 PTCKEY_SCROLLLOCK = $91; 174 PTCKEY_PRINTSCREEN = $9A; 175 PTCKEY_INSERT = $9B; 176 PTCKEY_HELP = $9C; 177 PTCKEY_META = $9D; 178 PTCKEY_MINUS = $BD; 179 PTCKEY_BACKQUOTE = $C0; 180 PTCKEY_QUOTE = $DE;