We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2949

Summary: [Android] Virtual DPAD remote not registered
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: ARM   
OS: Android (All)   
Attachments: patch

Description Sylvain 2015-04-17 18:17:54 UTC
I have an android device to which I try to connect the google virtual remote application.
https://play.google.com/store/apps/details?id=com.google.android.tv.remote

The java method "pollInputDevices()" detects it as an input source 0x701 which is (SOURCE_KEYBOARD | SOURCE_GAMEPAD | SOURCE_DPAD).

It it not added because it does not AND-bitwise with "SOURCE_CLASS_JOYSTICK".
It's only a virtual DPAD and it works when checking also with SOURCE_CLASS_BUTTON

              if( (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 ||
                   (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_BUTTON) != 0) {


See also:
https://bugzilla.libsdl.org/show_bug.cgi?id=2948


Thanks
Comment 1 Sam Lantinga 2015-06-17 05:19:25 UTC
Can you provide a tested patch for this issue?

Thanks!
Comment 2 Sylvain 2015-06-17 06:35:03 UTC
Created attachment 2181 [details]
patch

Here it is!
Comment 3 Sam Lantinga 2015-06-17 06:58:35 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/f6567f77f663