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

mouse support for android (non nvidia shield) #333

Open
GoogleCodeExporter opened this issue Feb 4, 2016 · 6 comments
Open

mouse support for android (non nvidia shield) #333

GoogleCodeExporter opened this issue Feb 4, 2016 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Hi, I first want to thank you for making an amazing port, it's by far the best 
Android release of mame that I've tried.

I have an Android development board (a Firefly-RK3288) which runs mame4droid 
(using 1.9.2). This board supports both mouse and keyboard via USB, however 
when running mame4droid the mouse merely acts as a touch pointer, and doesn't 
work in the games as a mouse/spinner. I've tried enabling the nvidia shield 
extensions yet the mouse is still not enabled/used (it just acts like an 
Android touch/pointer).

After looking at the code I can see that the nvidia shield mouse extensions 
appear to be specific to the nvidia shield sdk (no surprise). Can you tell me 
what would be needed to add similar support for mice on other platforms (such 
as the Firefly-RK3288)? Note that there's nothing special about the mouse on 
the Firefly-RK3288, it's merely a USB mouse that appears as a touch pointer in 
Android.

I'm an experienced C/C++ programmer so I don't mind doing the work, yet I need 
some guidance as I have little Android/Java experience.

Thanks!

~ G2M

Here's the link to the board:
http://wiki.t-firefly.com/index.php/Firefly-RK3288/en

Original issue reported on code.google.com by game2m...@gmail.com on 5 Jun 2015 at 7:30

@GoogleCodeExporter
Copy link
Author

You cant. Regular android has not relative mouse input api.

 If you really want to add mouse input you should root your device and read event from /dev/input queues. That's why I'm using nvidia extensions and I haven't added mouse support for regular android devices. 

Original comment by seleuco....@gmail.com on 6 Jun 2015 at 6:37

@GoogleCodeExporter
Copy link
Author

The board comes with root access enabled, so it should have /dev/input 
accessible.

Where in the code would I need to add the reading of /dev/input?

Thanks!

~ G2M

Original comment by game2m...@gmail.com on 6 Jun 2015 at 11:28

@GoogleCodeExporter
Copy link
Author

Not sure. You should encapsulate in a class. Tou should take a look on nvidia 
extensions. Maybe you can make factory which encapsulate boths implementations 
and replace direct nvidia mouse input. 

Original comment by seleuco....@gmail.com on 6 Jun 2015 at 5:54

@GoogleCodeExporter
Copy link
Author

Is there any way to do this in the mame code and not the java/android code? The 
mame code should be able to open /dev/input, no?

Original comment by game2m...@gmail.com on 7 Jun 2015 at 12:54

@GoogleCodeExporter
Copy link
Author

I think so, but you should do some kind of event injection and deal with jni. 

Anyway, take a look at this source code.  

https://github.com/moonlight-stream/moonlight-android/tree/master/app/src/main/j
ava/com/limelight/binding/input/evdev

Original comment by seleuco....@gmail.com on 7 Jun 2015 at 2:06

@GoogleCodeExporter
Copy link
Author

Will do, thanks for the tip!

~ G2M

Original comment by game2m...@gmail.com on 8 Jun 2015 at 12:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant