Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper mouse support for Android backend #2310

Merged
merged 1 commit into from
Sep 29, 2014

Conversation

Zomby2D
Copy link
Contributor

@Zomby2D Zomby2D commented Sep 7, 2014

This PR adds the handling of mouse cursor movement and scroll wheel on Android 3.1+. It also correctly report the mid and right mouse buttons on 4.0+

I've tested this with a USB mouse and the touchpad on my ASUS Transformer tablet. (Had to manually configure the tablet not to report mid/right buttons as menu and back.) I've also tested it on my old Archos 43 to make sure I didn't break anything all the way back to Android 2.2.

@MobiDevelop
Copy link
Member

We'll have to trust you I guess, I've never used a mouse with Android so couldn't verify this is correct and doesn't break anything.

@Zomby2D
Copy link
Contributor Author

Zomby2D commented Sep 7, 2014

This could be tested with a bluetooth mouse, a USB mouse with a OTG adapter, or a tablet which have a full-size USB connector. (Or a touchpad in the case of the Transformer's dock)

@MobiDevelop
Copy link
Member

I don't have any of those things.

@Zomby2D
Copy link
Contributor Author

Zomby2D commented Sep 7, 2014

I understand, although anyone can test that it doesn't break anything on the normal touch operations without using a mouse. As far as the mouse is concerned, someone else might be able to test it and confirm that it's working as intended.

@MobiDevelop
Copy link
Member

I understand that... I was just stating that I don't have those things so I won't be able to test and verify this works before merging.

@johnnyapol
Copy link
Member

@Zomby2D
@MobiDevelop

I have an OTG cable around here somewhere for my Nexus 7 (2013). I can test tonight and report back.

@MobiDevelop
Copy link
Member

Cool, thanks @unkn0wn0ne.

@Zomby2D
Copy link
Contributor Author

Zomby2D commented Sep 7, 2014

I just tried this on my Ouya (don't know why I didn't think about it before) and it correctly tracks the movement of the touchpad on the controller. I was also able to track movement/scroll/buttons from a USB mouse I plugged in.

@MobiDevelop
Copy link
Member

Ah, I also should have thought of that. I have an Ouya.

@Zomby2D
Copy link
Contributor Author

Zomby2D commented Sep 22, 2014

@unkn0wn0ne @MobiDevelop

Did you guys get a chance to try it out?

@badlogic
Copy link
Member

@MobiDevelop is this good to go?

@MobiDevelop
Copy link
Member

I haven't had a chance to try it with an actual mouse, but it doesn't break
normal touch behavior so there probably isn't any harm in pulling it in.

@Zomby2D
Copy link
Contributor Author

Zomby2D commented Sep 29, 2014

I have tested it thoroughly on various devices, with and without a mouse.

MobiDevelop added a commit that referenced this pull request Sep 29, 2014
Proper mouse support for Android backend
@MobiDevelop MobiDevelop merged commit 08db5e0 into libgdx:master Sep 29, 2014
@Zomby2D Zomby2D deleted the android-mouse branch September 29, 2014 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants