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 - [Android] Virtual DPAD remote not registered
Summary: [Android] Virtual DPAD remote not registered
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 2.0.3
Hardware: ARM Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-17 18:17 UTC by Sylvain
Modified: 2015-06-17 06:58 UTC (History)
0 users

See Also:


Attachments
patch (1010 bytes, patch)
2015-06-17 06:35 UTC, Sylvain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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