summaryrefslogtreecommitdiffhomepage
path: root/tracker-joystick/ftnoir_tracker_joystick.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:50:46 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:55:45 +0100
commit119671e4e7f4dc07c1fb20eb999a0a7fcfbbdba8 (patch)
tree0b90e43ed648217dd75a15e73dee93e477103903 /tracker-joystick/ftnoir_tracker_joystick.cpp
parent86f1df90b405b56b46d698b4059ed2c6b10df8b3 (diff)
api/shortcuts, tracker/joy: adapt to synchronized joy api
Diffstat (limited to 'tracker-joystick/ftnoir_tracker_joystick.cpp')
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tracker-joystick/ftnoir_tracker_joystick.cpp b/tracker-joystick/ftnoir_tracker_joystick.cpp
index 4c180eaa..112f20ca 100644
--- a/tracker-joystick/ftnoir_tracker_joystick.cpp
+++ b/tracker-joystick/ftnoir_tracker_joystick.cpp
@@ -8,8 +8,17 @@
#include "opentrack/plugin-api.hpp"
#include <QMutexLocker>
-FTNoIR_Tracker::FTNoIR_Tracker()
+FTNoIR_Tracker::FTNoIR_Tracker() : joy_ctx(win32_joy_ctx::make())
{
+ if (static_cast<QString>(s.guid) == "")
+ {
+ std::vector<win32_joy_ctx::joy_info> info = joy_ctx.get_joy_info();
+ if (info.size())
+ {
+ s.guid = info[0].guid;
+ s.b->save();
+ }
+ }
}
FTNoIR_Tracker::~FTNoIR_Tracker()