mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
x11: Fixed joystick read.
This commit is contained in:
parent
dc5cac62c5
commit
ad768598b1
1 changed files with 7 additions and 2 deletions
|
@ -63,6 +63,11 @@ namespace entry
|
|||
|
||||
struct Joystick
|
||||
{
|
||||
Joystick()
|
||||
: m_fd(-1)
|
||||
{
|
||||
}
|
||||
|
||||
void init()
|
||||
{
|
||||
m_fd = open("/dev/input/js0", O_RDONLY | O_NONBLOCK);
|
||||
|
@ -80,7 +85,7 @@ namespace entry
|
|||
|
||||
void shutdown()
|
||||
{
|
||||
if (0 != m_fd)
|
||||
if (-1 != m_fd)
|
||||
{
|
||||
close(m_fd);
|
||||
}
|
||||
|
@ -99,7 +104,7 @@ namespace entry
|
|||
|
||||
bool update(EventQueue& _eventQueue)
|
||||
{
|
||||
if (0 == m_fd)
|
||||
if (-1 == m_fd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue