#include <fcntl.h>
#include <linux/joystick.h>
+#include <msp/core/algorithm.h>
#include <msp/core/systemerror.h>
#include <msp/fs/dir.h>
#include <msp/io/handle_private.h>
Private::detected_controllers.clear();
FS::Path dev_input = "/dev/input";
- list<string> devices = FS::list_filtered(dev_input, "^js[0-9]+");
- devices.sort();
- for(list<string>::const_iterator i=devices.begin(); i!=devices.end(); ++i)
+ vector<string> devices = FS::list_filtered(dev_input, "^js[0-9]+");
+ sort(devices);
+ for(vector<string>::const_iterator i=devices.begin(); i!=devices.end(); ++i)
// TODO check permissions
Private::detected_controllers.push_back((dev_input / *i).str());