2
Free Pascal port of the OpenPTC C++ library.
3
Copyright (C) 2001-2003 Nikolay Nikolov (nickysn@users.sourceforge.net)
4
Original C++ version by Glenn Fiedler (ptc@gaffer.org)
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.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
Constructor TPTCKey.Create;
24
m_code := Integer(PTCKEY_UNDEFINED);
32
Constructor TPTCKey.Create(_code : Integer);
43
Constructor TPTCKey.Create(_code, _unicode : Integer);
47
m_unicode := _unicode;
54
Constructor TPTCKey.Create(_code, _unicode : Integer; _press : Boolean);
58
m_unicode := _unicode;
65
Constructor TPTCKey.Create(_code : Integer; _alt, _shift, _control : Boolean);
72
m_control := _control;
76
Constructor TPTCKey.Create(_code : Integer; _alt, _shift, _control, _press : Boolean);
83
m_control := _control;
87
Constructor TPTCKey.Create(_code, _unicode : Integer; _alt, _shift, _control : Boolean);
91
m_unicode := _unicode;
94
m_control := _control;
98
Constructor TPTCKey.Create(_code, _unicode : Integer;
99
_alt, _shift, _control, _press : Boolean);
103
m_unicode := _unicode;
106
m_control := _control;
110
Constructor TPTCKey.Create(Const key : TPTCKey);
116
Destructor TPTCKey.Destroy;
122
Procedure TPTCKey.Assign(Const key : TPTCKey);
126
Raise TPTCError.Create('self assignment is not allowed');
129
m_unicode := key.unicode;
131
m_shift := key.shift;
132
m_control := key.control;
133
m_press := key.press;
136
Function TPTCKey.Equals(Const key : TPTCKey) : Boolean;
139
Equals := (m_code = key.m_code) And (m_unicode = key.m_unicode) And
140
(m_alt = key.m_alt) And (m_shift = key.m_shift) And
141
(m_control = key.m_control) And (m_press = key.m_press);
144
Function TPTCKey.GetRelease : Boolean;
147
GetRelease := Not m_press;