Do we support real mouse device in android?

Currently, in android system, we cast ToucEvent to MouseEvent, It works fine.
But, I just connected a bluetooth mouse to my android device, is seems that no real mouse event is fired.
Just want to know , is it my fall or we don’t support a real mouse in android ?


It seems we really don’t, I tested it now too. Please open an issue for this, I will try to look into the causes. Do you have any clue for this issue?


No for now, but I’m checking classes in : com/jme3/input/android/
If I have any new idea I’ll post it in this thread.


See issue 2173.


It seems an AndroidMouseInput component is totally missing from here:

This will require introducing an implementation of the MouseInput interface for the Android API which must trigger the same events as the AndroidTouchInput. I will try to think of something that will link both events in an easy and clean way.


Well… the more you learn the more you don’t know :rofl: :rofl: :rofl::
1 android api : public final class MotionEvent extends InputEvent implements Parcelable
2 glfw : GLFW: Input guide
3 Mircosoft windows mouse class : Mouse Class (System.Windows.Input) | Microsoft Learn
It seems like windows system has a different MOUSE abstraction with that is in Android .
In general:
MS assume there is ONLY ONE mouse is functional, The static members of the Mouse class delegate to the primary MouseDevice of the calling thread’s input manager.
Android on the other hand assume there are multipul mouse like devices are useing (mouse, pen, finger, trackball) .

Here comes yet another Question:
Shall we have a multiple mouse input system?


Not for desktop.

…and for Android your best bet is to treat it like multitouch if you can.

For example, in Lemur on Android you can already drag different sliders with different fingers at the same time… I don’t see why a mouse would be any different than another finger in this case.


MouseInput is a complex of hover input, button inputs and scroll. They should be all delegated to touch events and not opened for the user. The trick is to capture these events and send them as touch events.

Yes, that is why I’m talking about ONE abstraction for both Desktop and Android.

1 Like

For desktop multi-mouse support , actually I’m thinking playing game in a very old fashion way:
two guy play monopoly like or race game on a PC, or three keyboard for typing games.