From: Mikko Rasa Date: Thu, 6 Jun 2019 09:39:00 +0000 (+0300) Subject: Sort game controller devices for consistency X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=06b42c8c1bd84c67c23a4245cbd5d3fc6f66f12b;p=libs%2Fgui.git Sort game controller devices for consistency Directory order might change as devices are plugged in and removed. --- diff --git a/source/input/linux/gamecontroller.cpp b/source/input/linux/gamecontroller.cpp index c00379d..38d9d2b 100644 --- a/source/input/linux/gamecontroller.cpp +++ b/source/input/linux/gamecontroller.cpp @@ -43,6 +43,7 @@ unsigned GameController::detect() FS::Path dev_input = "/dev/input"; list devices = FS::list_filtered(dev_input, "^js[0-9]+"); + devices.sort(); for(list::const_iterator i=devices.begin(); i!=devices.end(); ++i) // TODO check permissions Private::detected_controllers.push_back((dev_input / *i).str());