File: CastleKeysMouse.TInputPressRelease.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (268 lines) | stat: -rw-r--r-- 18,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleKeysMouse: Object TInputPressRelease</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<a name="TInputPressRelease"></a><h1 class="cio">Object TInputPressRelease</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td><a class="section" href="#PasDoc-Fields">Fields</a></td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td>Properties</td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a  href="CastleKeysMouse.html">CastleKeysMouse</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TInputPressRelease = object(TObject)</code></p>
<h2 class="description">Description</h2>
<p>
Input press or release event. Either key press/release or mouse button press/release or mouse wheel action. This is nicely matching with <a class="normal" href="CastleInputs.TInputShortcut.html">TInputShortcut</a> processing in <a class="normal" href="CastleInputs.html">CastleInputs</a>, so it allows to easily store and check for user actions.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="thisitem">TInputPressRelease</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Fields"></a><h3 class="summary">Fields</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a></b>: <a  href="CastleKeysMouse.html#TInputPressReleaseType">TInputPressReleaseType</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#Key">Key</a></b>: <a  href="CastleKeysMouse.html#TKey">TKey</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a></b>: char;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#MouseButton">MouseButton</a></b>: <a  href="CastleKeysMouse.html#TMouseButton">TMouseButton</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#FingerIndex">FingerIndex</a></b>: <a  href="CastleKeysMouse.html#TFingerIndex">TFingerIndex</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#Position">Position</a></b>: <a  href="CastleVectors.html#TVector2Single">TVector2Single</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#MouseWheelScroll">MouseWheelScroll</a></b>: Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleKeysMouse.TInputPressRelease.html#MouseWheelVertical">MouseWheelVertical</a></b>: boolean;</code></td>
</tr>
</table>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleKeysMouse.TInputPressRelease.html#MouseWheel">MouseWheel</a></b>: <a  href="CastleKeysMouse.html#TMouseWheelDirection">TMouseWheelDirection</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleKeysMouse.TInputPressRelease.html#IsKey">IsKey</a></b>(const AKey: <a  href="CastleKeysMouse.html#TKey">TKey</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleKeysMouse.TInputPressRelease.html#IsKey">IsKey</a></b>(const AKeyCharacter: char): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleKeysMouse.TInputPressRelease.html#IsMouseButton">IsMouseButton</a></b>(const AMouseButton: <a  href="CastleKeysMouse.html#TMouseButton">TMouseButton</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleKeysMouse.TInputPressRelease.html#ToString">ToString</a></b>: string;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleKeysMouse.TInputPressRelease.html#Description">Description</a></b>: string; deprecated;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Fields</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="EventType"></a><code><b>EventType</b>: <a  href="CastleKeysMouse.html#TInputPressReleaseType">TInputPressReleaseType</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Key"></a><code><b>Key</b>: <a  href="CastleKeysMouse.html#TKey">TKey</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
When <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> is itKey, this is the key pressed or released. Either Key &lt;&gt; K_None or <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a> &lt;&gt; #0 in this case. When <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> &lt;&gt; itKey, then Key = K_None and <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a> = #0.

<p>Both Key and <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a> represent the same action. Sometimes one, sometimes the other is useful.

<p>Not all keyboard keys can be represented as <a class="normal" href="CastleKeysMouse.html#TKey">TKey</a> value. For example, key '/' does not have any K_Xxx constant (it will have Key = K_None) for now but can be expressed as char '/'. Also not all keys can be represented as character, for example &quot;up arrow&quot; (K_Up) doesn't have a char code (it will have <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a> = #0).

<p><a class="normal" href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a> is influenced by some other keys state, like Shift or Ctrl or CapsLock or some key to input localized characters (all dependent on your system settings, we don't deal with it in our engine, we merely take what system gives us). For example, you can get &quot;a&quot; or &quot;A&quot; depending of Shift and CapsLock state, or <a class="normal" href="CastleStringUtils.html#CtrlA">CtrlA</a> if you hold Ctrl.

<p>When the user holds the key pressed, we will get consecutive key down events. Under some OSes, you will also get consecutive key up events, but it's not guaranteed (on some OSes, you may simply get only consecutive key down). So the more precise definition when key down occurs is: it's a notification that the key is (still) pressed down. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="KeyCharacter"></a><code><b>KeyCharacter</b>: char;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MouseButton"></a><code><b>MouseButton</b>: <a  href="CastleKeysMouse.html#TMouseButton">TMouseButton</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
When <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> is itMouseButton, this is the mouse button pressed or released. Always mbLeft for touch device press/release events.

<p><a class="normal" href="CastleWindow.html">CastleWindow</a> notes (but relevant also to other interfaces, like Lazarus component, although in that case it's beyond our control): When user presses the mouse over our control, mouse is automatically captured, so all further OnMotion following mouse release will be passed to this control (even if user moves mouse outside of this control), until user releases all mouse buttons. Note that this means that mouse positions may be outside of [0..Width - 1, 0..Height - 1] range.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="FingerIndex"></a><code><b>FingerIndex</b>: <a  href="CastleKeysMouse.html#TFingerIndex">TFingerIndex</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
When <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> is itMouseButton, this is the finger index pressed or released on a touch device. Always 0 for normal mouse events.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Position"></a><code><b>Position</b>: <a  href="CastleVectors.html#TVector2Single">TVector2Single</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
The position of the current mouse/finger on the window, for <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> = itMouseButton (in case of mouse press/release).

<p>For normal backends that simply support a single mouse device, this is just equivalent to TCastleWindow.MousePosition and TCastleControl.MousePosition, so it's not really interesting.

<p>For multi-touch devices, this is very useful, as it describes the position of the current finger (corresponding to <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#FingerIndex">FingerIndex</a>).

<p>For other <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> values (not itMouseButton), this is the position of main mouse/finger. See TCastleWindow.MousePosition documentation for what it means, in particular what happens on touch devices.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MouseWheelScroll"></a><code><b>MouseWheelScroll</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
When <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> is itMouseWheel, this is the mouse wheel action. <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#MouseWheel">MouseWheel</a> is mwNone if and only if <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> &lt;&gt; itMouseWheel.

<p>Positive value of Scroll means user scrolled up or left, negative means user scrolled down or right. It is never zero (as long as <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#EventType">EventType</a> = itMouseWheel of course).

<p>Scroll units are such that 1.0 should be treated like a &quot;one operation&quot;, like a one click. On most normal mouses only an integer scroll will be possible to make. On the other hand, on touchpads it's common to be able to scroll by flexible amounts.

<p><a class="normal" href="CastleWindow.html">CastleWindow</a> backends notes: GTK and Xlib cannot generate Scroll values different than 1 or -1.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MouseWheelVertical"></a><code><b>MouseWheelVertical</b>: boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MouseWheel"></a><code>function <b>MouseWheel</b>: <a  href="CastleKeysMouse.html#TMouseWheelDirection">TMouseWheelDirection</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsKey"></a><code>function <b>IsKey</b>(const AKey: <a  href="CastleKeysMouse.html#TKey">TKey</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check is event type correct, and then check if event Key or <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#KeyCharacter">KeyCharacter</a> matches. Always false for AKey = K_None or AKeyCharacter = #0. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsKey"></a><code>function <b>IsKey</b>(const AKeyCharacter: char): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsMouseButton"></a><code>function <b>IsMouseButton</b>(const AMouseButton: <a  href="CastleKeysMouse.html#TMouseButton">TMouseButton</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="ToString"></a><code>function <b>ToString</b>: string;</code></td>
</tr>
<tr><td colspan="2">
<p>
Textual description of this event.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Description"></a><code>function <b>Description</b>: string; deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p><p>
 Deprecated name for <a class="normal" href="CastleKeysMouse.TInputPressRelease.html#ToString">ToString</a>.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:10</em>
</span>
</td></tr></table></body></html>