nonarhero / android-bluez-ime

Automatically exported from code.google.com/p/android-bluez-ime
0 stars 0 forks source link

Support for MotionEvent AXIS_xxx returns #107

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Honeycomb maps the analogue sticks on pads to MotionEvents - specifically 
AXIS_X and AXIS_Y for the left pad, and AXIS_Z and AXIS_RZ for the right pad.

It would be nice to be able to map the joysticks in the same way Honeycomb 
does, for compatibility.

(I would just use the native Honeycomb support for this but the iControlPad has 
a really wierd button mappng that makes it basically unusable.. the sticks 
work, but nothing else does :p  So I hoped to use BluezIME to correct for it).

Original issue reported on code.google.com by tonyhoyl...@gmail.com on 25 Oct 2011 at 3:26

GoogleCodeExporter commented 8 years ago
I would really like this as well, but I have not yet found out how to send the 
MotionEvents. Do you have a hint? All I can find is how to read them ...

Original comment by kenneth@hexad.dk on 25 Oct 2011 at 3:31

GoogleCodeExporter commented 8 years ago
It's definately harder than it looks, having looked at the SDK.  

Suspect there's a method that's in the android source code somewhere, just not 
documented (well, if at all).

Original comment by tonyhoyl...@gmail.com on 25 Oct 2011 at 4:02

GoogleCodeExporter commented 8 years ago
I am not sure it is just exposed as a function. It could be that Google decided 
that a rogue app could send fake analog data and thus somehow compromise the 
security of the device, like dial a costly number or similar. If this is the 
case (which I think it is) it will only be possible to do with rooted devices.

Original comment by kenneth@hexad.dk on 25 Oct 2011 at 8:08

GoogleCodeExporter commented 8 years ago
You could get the current activity and call dispatchGenericMotionEvent on it.. 
provided you can get the current activity.

InputMethodManager has a dispatchTrackballEvent function, but alas it's not 
public.  That calls a similar function in InputMethodSession... that may be 
enough.  There's no dispatchGenericMotionEvent there, unless it's currently 
undocumented (not helped by the non-availability of source for 3.0+).

II can't see why they would limit IMEs sending generic motion events as they're 
specifically there for things like joysticks which aren't standard touch events 
(and as such have no security risks beyond what an IME can do already). 

Original comment by tonyhoyl...@gmail.com on 30 Oct 2011 at 1:31

GoogleCodeExporter commented 8 years ago
I have just seen that there is now an app that can make any BluezIME controller 
send hardware buttons presses and analog data. That should make any Bluez IME 
controller able to act like a Xperia controller, but it requires Android 3.1 
and a rooted device:

https://play.google.com/store/apps/details?id=com.dancingpixelstudios.gamepadena
bler

It is not free, but cheap. I have no affiliation with the author of the app.

Original comment by kenneth@hexad.dk on 10 Apr 2012 at 11:19