From 06b42c8c1bd84c67c23a4245cbd5d3fc6f66f12b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 6 Jun 2019 12:39:00 +0300 Subject: [PATCH] Sort game controller devices for consistency Directory order might change as devices are plugged in and removed. --- source/input/linux/gamecontroller.cpp | 1 + 1 file changed, 1 insertion(+) 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()); -- 2.45.2