Joystick events issue

Having an issue with the joystick events. At some point (I can’t
determine when) joystick support in my game stopped working on Linux.
I checked other programs and it works just fine. I tried upgrading SDL
(I was still using 2.0.0) and that didn’t work. I used printf to log
the events and it turns out I only get the button release events (not
the press events and not the axis events).

Any idea of what may have gone wrong?

I’m using SDL in Linux too. These events have worked fine for me for a
long time. Currently using hg rev 8086. Could it be a problem in your
device support or elsewhere in Linux?–
Terry Welsh
www.reallyslick.com

Message: 3
Date: Sun, 12 Jan 2014 07:09:11 -0200
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: [SDL] Joystick events issue
Message-ID:
<CAEyBR+VJgp1jSTp282xBz3UL-Drv0rHcumgGDbvKKcr_BQs7-Q at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Having an issue with the joystick events. At some point (I can’t
determine when) joystick support in my game stopped working on Linux.
I checked other programs and it works just fine. I tried upgrading SDL
(I was still using 2.0.0) and that didn’t work. I used printf to log
the events and it turns out I only get the button release events (not
the press events and not the axis events).

Any idea of what may have gone wrong?

I explicitly stated I looked other programs to see if something else
had broken and the joystick worked just fine.

2014/1/12, Terry Welsh :> I’m using SDL in Linux too. These events have worked fine for me for a

long time. Currently using hg rev 8086. Could it be a problem in your
device support or elsewhere in Linux?

Terry Welsh
www.reallyslick.com

Message: 3
Date: Sun, 12 Jan 2014 07:09:11 -0200
From: Sik the hedgehog <@Sik_the_hedgehog>
To: SDL Development List
Subject: [SDL] Joystick events issue
Message-ID:

<CAEyBR+VJgp1jSTp282xBz3UL-Drv0rHcumgGDbvKKcr_BQs7-Q at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Having an issue with the joystick events. At some point (I can’t
determine when) joystick support in my game stopped working on Linux.
I checked other programs and it works just fine. I tried upgrading SDL
(I was still using 2.0.0) and that didn’t work. I used printf to log
the events and it turns out I only get the button release events (not
the press events and not the axis events).

Any idea of what may have gone wrong?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Does that mean other SDL 2 programs?

Jonny DOn Sun, Jan 12, 2014 at 8:11 PM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

I explicitly stated I looked other programs to see if something else
had broken and the joystick worked just fine.

2014/1/12, Terry Welsh :

I’m using SDL in Linux too. These events have worked fine for me for a
long time. Currently using hg rev 8086. Could it be a problem in your
device support or elsewhere in Linux?

Terry Welsh
www.reallyslick.com

Message: 3
Date: Sun, 12 Jan 2014 07:09:11 -0200
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: [SDL] Joystick events issue
Message-ID:

<CAEyBR+VJgp1jSTp282xBz3UL-Drv0rHcumgGDbvKKcr_BQs7-Q at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Having an issue with the joystick events. At some point (I can’t
determine when) joystick support in my game stopped working on Linux.
I checked other programs and it works just fine. I tried upgrading SDL
(I was still using 2.0.0) and that didn’t work. I used printf to log
the events and it turns out I only get the button release events (not
the press events and not the axis events).

Any idea of what may have gone wrong?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Didn’t check other SDL2 programs, I checked one with SDL 1.2 though.

Also just checked my game on Windows and it works just fine there
(both SDL 2.0.0 and 2.0.1) so the issue is specific to Linux.

2014/1/13, Jonathan Dearborn :> Does that mean other SDL 2 programs?

Jonny D

On Sun, Jan 12, 2014 at 8:11 PM, Sik the hedgehog < @Sik_the_hedgehog> wrote:

I explicitly stated I looked other programs to see if something else
had broken and the joystick worked just fine.

2014/1/12, Terry Welsh :

I’m using SDL in Linux too. These events have worked fine for me for a
long time. Currently using hg rev 8086. Could it be a problem in your
device support or elsewhere in Linux?

Terry Welsh
www.reallyslick.com

Message: 3
Date: Sun, 12 Jan 2014 07:09:11 -0200
From: Sik the hedgehog <@Sik_the_hedgehog>
To: SDL Development List
Subject: [SDL] Joystick events issue
Message-ID:

<CAEyBR+VJgp1jSTp282xBz3UL-Drv0rHcumgGDbvKKcr_BQs7-Q at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Having an issue with the joystick events. At some point (I can’t
determine when) joystick support in my game stopped working on Linux.
I checked other programs and it works just fine. I tried upgrading SDL
(I was still using 2.0.0) and that didn’t work. I used printf to log
the events and it turns out I only get the button release events (not
the press events and not the axis events).

Any idea of what may have gone wrong?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Have you tried compiling the SDL2 tests found in the official source distribution under the test directory? You will find an example called testjoystick that can be ran. Be sure to pass your joystick ID as the first argument (probably zero) – “testjoystick 0” works in my case.

Hopefully this helps to pinpoint the source of the problem.

Cheers!On 2014/01/ 13, at 9:03, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

Didn’t check other SDL2 programs, I checked one with SDL 1.2 though.

Also just checked my game on Windows and it works just fine there
(both SDL 2.0.0 and 2.0.1) so the issue is specific to Linux.

2014/1/13, Jonathan Dearborn :

Does that mean other SDL 2 programs?

Jonny D

On Sun, Jan 12, 2014 at 8:11 PM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

I explicitly stated I looked other programs to see if something else
had broken and the joystick worked just fine.

2014/1/12, Terry Welsh :

I’m using SDL in Linux too. These events have worked fine for me for a
long time. Currently using hg rev 8086. Could it be a problem in your
device support or elsewhere in Linux?

Terry Welsh
www.reallyslick.com

Message: 3
Date: Sun, 12 Jan 2014 07:09:11 -0200
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: [SDL] Joystick events issue
Message-ID:

<CAEyBR+VJgp1jSTp282xBz3UL-Drv0rHcumgGDbvKKcr_BQs7-Q at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Having an issue with the joystick events. At some point (I can’t
determine when) joystick support in my game stopped working on Linux.
I checked other programs and it works just fine. I tried upgrading SDL
(I was still using 2.0.0) and that didn’t work. I used printf to log
the events and it turns out I only get the button release events (not
the press events and not the axis events).

Any idea of what may have gone wrong?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Updated Ubuntu distro to 13.04, didn’t help.

Checked the test program. Only button release events are reported at
all, none of the other events is. SDL_JoystickGetAxis and
SDL_JoystickGetHat seem to work, though. Weird o.O

By default SDL will only send events while your application has focus.
There’s a hint to enable events all the time:
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS

Cheers!On Wed, Jan 15, 2014 at 8:27 AM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

Updated Ubuntu distro to 13.04, didn’t help.

Checked the test program. Only button release events are reported at
all, none of the other events is. SDL_JoystickGetAxis and
SDL_JoystickGetHat seem to work, though. Weird o.O


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Um, but I don’t get events while the game has focus (and doesn’t
explain why do I get two of the events: added and button release)…

2014/1/16, Sam Lantinga :> By default SDL will only send events while your application has focus.

There’s a hint to enable events all the time:
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS

Cheers!

On Wed, Jan 15, 2014 at 8:27 AM, Sik the hedgehog < @Sik_the_hedgehog> wrote:

Updated Ubuntu distro to 13.04, didn’t help.

Checked the test program. Only button release events are reported at
all, none of the other events is. SDL_JoystickGetAxis and
SDL_JoystickGetHat seem to work, though. Weird o.O


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Any ideas? :confused:

2014/1/16, Sik the hedgehog <@Sik_the_hedgehog>:> Um, but I don’t get events while the game has focus (and doesn’t

explain why do I get two of the events: added and button release)…

2014/1/16, Sam Lantinga :

By default SDL will only send events while your application has focus.
There’s a hint to enable events all the time:
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS

Cheers!

On Wed, Jan 15, 2014 at 8:27 AM, Sik the hedgehog < @Sik_the_hedgehog> wrote:

Updated Ubuntu distro to 13.04, didn’t help.

Checked the test program. Only button release events are reported at
all, none of the other events is. SDL_JoystickGetAxis and
SDL_JoystickGetHat seem to work, though. Weird o.O


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Message-ID:
<CAEyBR+WNb4aC0JxrSvzbJZcfCmrM0-n-yoH-8VgV=7RSbc_GTQ at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Any ideas? :confused:

2014/1/16, Sik the hedgehog <sik.the.hedgehog at gmail.com>:

Um, but I don’t get events while the game has focus (and doesn’t
explain why do I get two of the events: added and button release)…

2014/1/16, Sam Lantinga :

By default SDL will only send events while your application has focus.
There’s a hint to enable events all the time:
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS

Cheers!

Updated Ubuntu distro to 13.04, didn’t help.

Checked the test program. Only button release events are reported at
all, none of the other events is. SDL_JoystickGetAxis and
SDL_JoystickGetHat seem to work, though. Weird o.O


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

From the… overwhelming response, I’d say that everyone is cleanly
divided into the “don’t have this problem” or “have no idea what
causes this problem” camps.

Have you tried a simple X11 (I think you said earlier that you’re
using X?) test app to see if you can duplicate the problem there? How
about copying the SDL2 X11 code into a custom app, and slowly cutting
out pieces until you get a least-complexity bug demo?> Date: Sat, 18 Jan 2014 17:49:20 -0200

From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] Joystick events issue

On Wed, Jan 15, 2014 at 8:27 AM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

…and then I update to Ubuntu 13.10 and suddenly the problem is gone
o.O Is this a problem specific to 13.04 then?

2014/1/19, Jared Maddox :>> Date: Sat, 18 Jan 2014 17:49:20 -0200

From: Sik the hedgehog <@Sik_the_hedgehog>
To: SDL Development List
Subject: Re: [SDL] Joystick events issue
Message-ID:
<CAEyBR+WNb4aC0JxrSvzbJZcfCmrM0-n-yoH-8VgV=7RSbc_GTQ at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Any ideas? :confused:

2014/1/16, Sik the hedgehog <@Sik_the_hedgehog>:

Um, but I don’t get events while the game has focus (and doesn’t
explain why do I get two of the events: added and button release)…

2014/1/16, Sam Lantinga :

By default SDL will only send events while your application has focus.
There’s a hint to enable events all the time:
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS

Cheers!

On Wed, Jan 15, 2014 at 8:27 AM, Sik the hedgehog < @Sik_the_hedgehog> wrote:

Updated Ubuntu distro to 13.04, didn’t help.

Checked the test program. Only button release events are reported at
all, none of the other events is. SDL_JoystickGetAxis and
SDL_JoystickGetHat seem to work, though. Weird o.O


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

From the… overwhelming response, I’d say that everyone is cleanly
divided into the “don’t have this problem” or “have no idea what
causes this problem” camps.

Have you tried a simple X11 (I think you said earlier that you’re
using X?) test app to see if you can duplicate the problem there? How
about copying the SDL2 X11 code into a custom app, and slowly cutting
out pieces until you get a least-complexity bug demo?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org