X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/627b2b2a0db4017fe243ee5d676b04eebf5bb632..206391cbab43aa5f0731ddfc42b8ea80f6170014:/src/unix/joystick.cpp diff --git a/src/unix/joystick.cpp b/src/unix/joystick.cpp index 0a32033ee3..a9c434cbc1 100644 --- a/src/unix/joystick.cpp +++ b/src/unix/joystick.cpp @@ -183,10 +183,17 @@ wxJoystick::wxJoystick(int joystick) { wxString dev_name; - // Assume it's the same device name on all Linux systems ... + // old /dev structure dev_name.Printf( wxT("/dev/js%d"), (joystick == wxJOYSTICK1) ? 0 : 1); m_device = open(dev_name.fn_str(), O_RDONLY); + // new /dev structure with "input" subdirectory + if (m_device == -1) + { + dev_name.Printf( wxT("/dev/input/js%d"), (joystick == wxJOYSTICK1) ? 0 : 1); + m_device = open(dev_name.fn_str(), O_RDONLY); + } + if (m_device != -1) { m_thread = new wxJoystickThread(m_device, m_joystick);