summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_joystick
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-01-03 21:17:14 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-01-03 21:17:14 +0100
commitfcbce27643f7017af6e9fc5affa39fc5e40643d7 (patch)
tree818996455645d9dd37ef4fd5e31a3ad3c13e032d /ftnoir_tracker_joystick
parent56bdd3ba1dcfb2153e31e8479c7268ddcb620ddd (diff)
Store joystick selection as friendly name, not arbitrary device index
Diffstat (limited to 'ftnoir_tracker_joystick')
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp2
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index 28fc034a..e605ea40 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -10,7 +10,7 @@ static BOOL CALLBACK EnumJoysticksCallback2( const DIDEVICEINSTANCE* pdidInstanc
self->def = *pdidInstance;
- return self->iter++ == self->s.joyid ? DIENUM_STOP : DIENUM_CONTINUE;
+ return QString(pdidInstance->tszInstanceName) == self->s.joyid ? DIENUM_STOP : DIENUM_CONTINUE;
}
FTNoIR_Tracker::FTNoIR_Tracker() :
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
index bd261a25..2f630d18 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
@@ -55,7 +55,7 @@ struct settings {
axis_3(b, "axis-3", 0),
axis_4(b, "axis-4", 0),
axis_5(b, "axis-5", 0),
- joyid(b, "joy-id", 0),
+ joyid(b, "joy-id", ""),
axes{&axis_0, &axis_1, &axis_2, &axis_3, &axis_4, &axis_5}
{}
};