summaryrefslogtreecommitdiffhomepage
path: root/opentrack/win32-joystick.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-06 20:13:56 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-06 20:13:56 +0100
commit4864dfaa4b455905fece5cd93502b80890d1b2d2 (patch)
tree094dcbb5e6fc30a2105871d1d7825b5482361145 /opentrack/win32-joystick.cpp
parent75b4a6e3a32b4345941e15953d55572384eb210e (diff)
api/joy: move from header
Diffstat (limited to 'opentrack/win32-joystick.cpp')
-rw-r--r--opentrack/win32-joystick.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/opentrack/win32-joystick.cpp b/opentrack/win32-joystick.cpp
index 73e27f80..728e2f68 100644
--- a/opentrack/win32-joystick.cpp
+++ b/opentrack/win32-joystick.cpp
@@ -292,4 +292,19 @@ win32_joy_ctx::enum_state::EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE *pdi
return DIENUM_CONTINUE;
}
+win32_joy_ctx::joy::joy(LPDIRECTINPUTDEVICE8 handle, const QString &guid, const QString &name)
+ : joy_handle(handle), guid(guid), name(name)
+{
+ qDebug() << "got joy" << guid;
+ for (int i = 0; i < 128; i++)
+ pressed[i] = false;
+ memset(&js_old, 0, sizeof(js_old));
+}
+
+win32_joy_ctx::joy::~joy()
+{
+ qDebug() << "nix joy" << guid;
+ release();
+}
+
#endif