Fix joystick pathname construction
This commit is contained in:
parent
188f713900
commit
7ee0734470
@ -49,8 +49,8 @@ namespace
|
|||||||
|
|
||||||
for (unsigned int i = 0; i < sf::Joystick::Count; ++i)
|
for (unsigned int i = 0; i < sf::Joystick::Count; ++i)
|
||||||
{
|
{
|
||||||
std::ostringstream name("js");
|
std::ostringstream name;
|
||||||
name << i;
|
name << "js" << i;
|
||||||
std::string nameString = name.str();
|
std::string nameString = name.str();
|
||||||
|
|
||||||
int file = ::open(("/dev/input/" + nameString).c_str(), O_RDONLY);
|
int file = ::open(("/dev/input/" + nameString).c_str(), O_RDONLY);
|
||||||
@ -260,8 +260,8 @@ bool JoystickImpl::open(unsigned int index)
|
|||||||
{
|
{
|
||||||
if (plugged[index])
|
if (plugged[index])
|
||||||
{
|
{
|
||||||
std::ostringstream name("/dev/input/js");
|
std::ostringstream name;
|
||||||
name << index;
|
name << "/dev/input/js" << index;
|
||||||
|
|
||||||
// Open the joystick's file descriptor (read-only and non-blocking)
|
// Open the joystick's file descriptor (read-only and non-blocking)
|
||||||
m_file = ::open(name.str().c_str(), O_RDONLY | O_NONBLOCK);
|
m_file = ::open(name.str().c_str(), O_RDONLY | O_NONBLOCK);
|
||||||
|
Loading…
Reference in New Issue
Block a user