diff options
-rw-r--r-- | ftnoir_tracker_libevdev/ftnoir_libevdev.ui | 4 | ||||
-rw-r--r-- | ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp | 6 | ||||
-rw-r--r-- | ftnoir_tracker_libevdev/ftnoir_tracker_libevdev_dialog.cpp | 8 |
3 files changed, 5 insertions, 13 deletions
diff --git a/ftnoir_tracker_libevdev/ftnoir_libevdev.ui b/ftnoir_tracker_libevdev/ftnoir_libevdev.ui index e45ab34a..6c1ebcae 100644 --- a/ftnoir_tracker_libevdev/ftnoir_libevdev.ui +++ b/ftnoir_tracker_libevdev/ftnoir_libevdev.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>335</width> - <height>85</height> + <width>677</width> + <height>90</height> </rect> </property> <property name="windowTitle"> diff --git a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp index a36e821c..8bb35314 100644 --- a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp +++ b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp @@ -29,8 +29,7 @@ FTNoIR_Tracker::~FTNoIR_Tracker() void FTNoIR_Tracker::StartTracker(QFrame*) { - QString pretty_name = s.device_name; - QString node_name = "usb-" + pretty_name.replace(' ', '_') + "-event-joystick"; + QString node_name = s.device_name; std::string str = (QString("/dev/input/by-id/") + node_name).toStdString(); const char* filename = str.c_str(); @@ -63,8 +62,7 @@ void FTNoIR_Tracker::GetHeadPoseData(double *data) { if (node) { - int max = 64; - while (libevdev_has_event_pending(node) == 1 && max-- > 0) + while (libevdev_has_event_pending(node) == 1) { struct input_event ev; int status = libevdev_next_event(node, LIBEVDEV_READ_FLAG_NORMAL, &ev); diff --git a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev_dialog.cpp b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev_dialog.cpp index 267101be..e0126283 100644 --- a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev_dialog.cpp +++ b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev_dialog.cpp @@ -13,15 +13,9 @@ TrackerControls::TrackerControls() ui.comboBox->clear(); QDir dir("/dev/input/by-id"); - auto devices = dir.entryList(QStringList { "usb-?*-event-joystick"}); + auto devices = dir.entryList(QStringList { "usb-?*-event-?*"}); for (QString dev : devices) - { - dev.replace(QRegularExpression("^usb-"), ""); - dev.replace(QRegularExpression("-event-.[^-]*"), ""); - dev.replace("_", " "); ui.comboBox->addItem(dev); - } - tie_setting(s.device_name, ui.comboBox); } |