2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
28 namespace DirectInput
\r
31 /// Describes the state of a joystick device.
\r
33 /// <unmanaged>DIJOYSTATE2</unmanaged>
\r
34 public ref class JoystickState
\r
37 unsigned int timeStamp;
\r
44 array<int>^ sliders;
\r
46 array<bool>^ pressedButtons;
\r
47 array<bool>^ releasedButtons;
\r
54 array<int>^ vsliders;
\r
61 array<int>^ asliders;
\r
68 array<int>^ fsliders;
\r
70 JoystickState( const DIJOYSTATE2 &joystate );
\r
76 ///
\83^
\83C
\83\80\83X
\83^
\83\93\83v
\82ð
\95Ô
\82·
\81B
\r
78 property unsigned int TimeStamp
\r
80 unsigned int get() { return timeStamp; }
\r
84 /// Gets the state of each point-of-view controller on the joystick.
\r
86 array<int>^ GetPointOfViewControllers()
\r
92 /// Gets the position of each slider on the joystick.
\r
94 array<int>^ GetSliders()
\r
100 /// Gets the velocity of each slider on the joystick.
\r
102 array<int>^ GetVelocitySliders()
\r
108 /// Gets the acceleration of each slider on the joystick.
\r
110 array<int>^ GetAccelerationSliders()
\r
116 /// Gets the force of each slider on the joystick.
\r
118 array<int>^ GetForceSliders()
\r
124 /// Gets the state of each button on the joystick.
\r
126 array<bool>^ GetButtons()
\r
128 return pressedButtons;
\r
132 /// Gets the X-axis, usually the left-right movement of a stick.
\r
136 int get() { return x; }
\r
140 /// Gets the Y-axis, usually the forward-backward movement of a stick.
\r
144 int get() { return y; }
\r
148 /// Gets the Z-axis, often the throttle control.
\r
152 int get() { return z; }
\r
156 /// Gets the X-axis rotation.
\r
158 property int RotationX
\r
160 int get() { return rx; }
\r
164 /// Gets the Y-axis rotation.
\r
166 property int RotationY
\r
168 int get() { return ry; }
\r
172 /// Gets the Z-axis rotation.
\r
174 property int RotationZ
\r
176 int get() { return rz; }
\r
180 /// Gets the X-axis velocity.
\r
182 property int VelocityX
\r
184 int get() { return vx; }
\r
188 /// Gets the Y-axis velocity.
\r
190 property int VelocityY
\r
192 int get() { return vy; }
\r
196 /// Gets the Z-axis velocity.
\r
198 property int VelocityZ
\r
200 int get() { return vz; }
\r
204 /// Gets the X-axis angular velocity.
\r
206 property int AngularVelocityX
\r
208 int get() { return vrx; }
\r
212 /// Gets the Y-axis angular velocity.
\r
214 property int AngularVelocityY
\r
216 int get() { return vry; }
\r
220 /// Gets the Z-axis angular velocity.
\r
222 property int AngularVelocityZ
\r
224 int get() { return vrz; }
\r
228 /// Gets the X-axis acceleration.
\r
230 property int AccelerationX
\r
232 int get() { return ax; }
\r
236 /// Gets the Y-axis acceleration.
\r
238 property int AccelerationY
\r
240 int get() { return ay; }
\r
244 /// Gets the Z-axis acceleration.
\r
246 property int AccelerationZ
\r
248 int get() { return az; }
\r
252 /// Gets the X-axis angular acceleration.
\r
254 property int AngularAccelerationX
\r
256 int get() { return arx; }
\r
260 /// Gets the Y-axis angular acceleration.
\r
262 property int AngularAccelerationY
\r
264 int get() { return ary; }
\r
268 /// Gets the Z-axis angular acceleration.
\r
270 property int AngularAccelerationZ
\r
272 int get() { return arz; }
\r
276 /// Gets the X-axis force.
\r
278 property int ForceX
\r
280 int get() { return fx; }
\r
284 /// Gets the Y-axis force.
\r
286 property int ForceY
\r
288 int get() { return fy; }
\r
292 /// Gets the Z-axis force.
\r
294 property int ForceZ
\r
296 int get() { return fz; }
\r
300 /// Gets the X-axis torque.
\r
302 property int TorqueX
\r
304 int get() { return frx; }
\r
308 /// Gets the Y-axis torque.
\r
310 property int TorqueY
\r
312 int get() { return fry; }
\r
316 /// Gets the Z-axis torque.
\r
318 property int TorqueZ
\r
320 int get() { return frz; }
\r
323 bool IsPressed( int button ) { return pressedButtons[button]; }
\r
324 bool IsReleased( int button ) { return releasedButtons[button]; }
\r
327 void AssignState( const DIJOYSTATE2 &joystate );
\r