Forums » Android

Transformer keyboard/mouse support?

12»
May 27, 2011 ConstantineXVI link
I've got the keyboard dock for the Asus Transformer, wondering if it would be feasible to enable proper keyboard/mouse support in the Android version. Think the keyboard kind of works already (WASD didn't seem to work for throttle, but arrow keys did), what I'm not sure on is if proper mouse support is possible. Android doesn't get official mouse support until 3.1 (the Transformer's on 3.0, they're claiming early next month for 3.1); not sure if you can actually get cursor position via however Asus hacked mouse support in.
May 27, 2011 incarnate link
I don't really know. We don't have an Asus Transformer for testing, and we also haven't yet dug into the Android 3.1 mouse/keyboard support. It is supposedly much improved, and we're hoping we can actually grab the mouse and use it as "mouselook", but we haven't had a chance to go down that development road as of yet.

Hopefully this summer we'll have a build with some keyboard and mouse improvements.
May 29, 2011 samuel.penn link
Just popped in to ask about this... I've been trying it on the Transformer as well, and though the cursor keys worked, the WASD keys didn't seem to work at all. Some of the other keys did work - such as 'Enter' to activate etc. Being able to fly with the keyboard would be a big improvement. Personally, I'm not too fussed about mouse.

Thanks,
Sam.
May 29, 2011 ConstantineXVI link
Chiming in again, after installing the 3.1 update that was just leaked things are already better. WASD keys are fine now, so keyboard controls seem to be go. The 3.1 APIs add in ACTION_HOVER_MOVE[1], so full mouselook should be possible. The keyboard/mouse support in 3.1 should extend to normal USB/Bluetooth keyboard and mice as well as the Transformer dock, which means that all this would work on a properly equipped Xoom or such as well.

EDIT: Checked more throughly, the entire keyboard's working. 3.1's supposed to be pushed to the TF officially this week, you don't have long to wait if you aren't brave enough to install a leak.

And even though it's suicide to use one :), 3.1 also brings in gamepad and joystick support (PS3 and 360 controllers are explicitly mentioned)[2], so that's possible also.

[1] http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_HOVER_MOVE

[2] http://developer.android.com/reference/android/view/InputDevice.html#SOURCE_GAMEPAD
Jun 02, 2011 incarnate link
Well that's great news. Keyboard controls are actually very good, and should hold up well in the meantime, until we bring more advanced mouse control online.
Jun 05, 2011 bazjscottj link
I like the fact it works on my PS3 controller. Shame I can only look/aim with it. http://youtu.be/peymGbiQM5I
Jun 06, 2011 samuel.penn link
I got the official 3.1 upgrade last week, but the keyboard still wasn't working properly. I also tried a PS3 controller, which seemed to have no effect.

What options are people using for the Vendetta controls (keyboard/mouse, accelerometer etc)?

Sam.
Jun 30, 2011 bobcat_linux link
Not having any luck on the transformer keyboard. When I select keyboard/accellerometer, space, tab, n,m,p,] and the arrows work, and though I can set the controls to wasd, they don't work. When I switch to keyboard/mouse, nothing works. The mouse works when I click on things, but not for steering.
Aug 18, 2011 dotmaq link
Tried it on a 3.2 rom:
hardware keyboard seems to work perfectly

to make any use of mouse/touchpad need to disable 'touchscreen mode' in interface options (which makes sense i suppose, tho it'd be nice if touchscreen could be recognized separately somehow)

left click is recognized as 'touch event' or something, again same as touching the screen, but does work properly (ie you can bind stuff to it and it works)
moving mouse or touchpad with nothing pressed causes cursor to show up and move but won't steer the ship
moving mouse/touchpad with left button pressed lets you steer the ship like normal

right button of course works as 'back button' as per android's idiotic and unchangable default so it opens options

also in options/controls/keyboard dialog starting to move the mouse is treated as clicking wherever the cursor was at that moment
Aug 25, 2011 hoodvisions link
Just tried on a Galaxy Tab 10.1 with 3.1 honeycomb, bt keyboard and usb mouse plugged in.

Keyboard works fine, but I cannot press multiple keys at once, so strafing is kinda hard to do. Outside of VO I can press multiple keys at once and it gets recognized.

Mouse works fine as a cursor and I can click everything. With Touchscreen turned off in the options I can also use the mouse for steering, but only while holding mousebutton and only in a limited range (until cursor hits border of the screen).

I was playing around with all kinds of options in VO and honeycomb itself, but I cannot get the mouse to not behave as a cursor/pointer and the keyboard only accepts one key pressed at the same time... Still a slight improvement in steering ^^
Aug 25, 2011 incarnate link
What specific BT keyboard and USB mouse are you using with your Galaxy Tab 10.1?

Current mouse support is limited to the traditional Android interpretation of a "virtual finger", which isn't real helpful. We can probably do full mouse capture ("mouselook") with the newer USB API in 3.1 (?) or better, but we haven't yet attempted to do that. It may be a little while before we can get to it.

I think it's pretty bizarre that the BT keyboard only lets you type one character at a time. We tested extensively with USB keyboards back in the Froyo era, and that always worked fine. The Transformer we have works great as well. But we haven't tested much with BT.
Aug 26, 2011 hoodvisions link
I am using a Freedom Universal 2 bt keyboard. Going to try with a different one tomorrow.
Btw, it's really cool that you actually care for the community :-)
Aug 27, 2011 incarnate link
We try :). We don't always succeed, but we definitely care.

Let me know if a different keyboard helps. Thanks.
Aug 27, 2011 hoodvisions link
Okay, could only get another, older freedom bt keyboard... Pretty much does the same, so it is more or less impossible to strafe left and up at the same time. Reassigned some keys here and there to see if this is limited to certain ones, but didnt help. As soon as I press a second key while holding another one it is only the last key being recognized. Still I think I could live with it if the mouselook would work ^^
Wondering if it is the keyboards "fault" nonetheless.
Sep 11, 2011 davr link
I have an Acer Iconia Tab A500 with a mouse & keyboard hooked up by USB (they're wireless, but that shouldn't make a difference). The keyboard works well, but same thing as previous people, the mouse doesn't get captured by the game. I can do sort of a basic mouselook by holding down the left mouse button, but as soon as the cursor hits the edge of the screen, I can't go any further. I hope you guys can add support for this, for me, the touchscreen and accelerometer controls are neat, but hard to actually play the game with. Thanks!
Sep 12, 2011 incarnate link
I highly recommend trying just keyboard-only mode. Basically, you go into Options, Interface and uncheck "Enable Touchscreen mode". Then just launch and play using the arrow keys and W/A/S/D. There are key bindings for practically everything, and you can actually be pretty strong at combat with just the keyboard.

We will eventually try to do a captured-mouselook mode for mice. This only became technically feasible since Android.. 3.2? I think? The prior mouse API made mouselook effectively impossible, despite our extensive attempts to do so in 2010 (working with Google, and also prodding them to add the option).
Mar 27, 2012 Gary13579 link
Any progress on this? Mouse support in Android is the only thing holding me back from subscribing. 99% of my work and entertainment is on my tablet, and I'd really love a good MMO to play (let's be honest, pocket legends sucks).

I don't believe mouselook was possible in 3.x, only mousehover which doesn't help. As of ICS though, capturing the mouse is possible, which means a full mouselook is entirely doable. The APIs for it look pretty simple, it shouldn't take more than an hour to do. Pleeeease :D?
Mar 28, 2012 incarnate link
Umm, I've been talking to Google since the release of ICS, and I'm not aware of any improvements to mouse capture in that update? They clearly weren't either, since I was grousing about that issue at GDC. There is a mouse/joystick/USB API (3.1+), but you still can't get relative events (only absolute), and you still can't get rid of the mouse cursor. NVIDIA has also done a deep dive on this too, and concurred with what we found. I mean.. we dug into the Android source.

The best idea we've had is to actually write our own HID driver and pull in the low-level USB data, bypassing all the APIs entirely. This would (theoretically) let us capture the mouse motion, but we still wouldn't be able to get rid of the cursor on screen. It would also probably be a bit time consuming to develop.

But, anyway, if there's some new development I've somehow missed, I'd welcome being directed to it.

In all seriousness though, our keyboard support is pretty solid, if you have a Transformer. I'm not just saying that.. I played entirely with the KB for a couple of years.
Mar 28, 2012 Gary13579 link
Thank you for your response, incarnate. Perhaps I was misinformed. I received that information from a Googler on IRC about the time that ICS dropped, he told me that it was supported as of SDK platform 14, or ICS. I will continue to look into it and try to find if it's possible. I was also incredibly certain that I have seen some ICS apps that use this (specifically, a DosBox app), so I will buy that and try to figure out how it works.

The keyboard support has serious problems. I cannot be sure because of a hardware issue, or if it's a Vendetta bug, but I am assuming it's a hardware bug. If I hold W to start accelerating, then tap the left button once or twice, the ship gets stuck turning left until I release the W button. This happens with a few key combos, but it's mainly W and left that it appears to happen on. Turning right, up, and down while holding W are all fine. It makes it basically impossible to navigate, especially during combat.

On a related matter, does Vendetta support Android's controller API that was introduced in 3.1? Adding support is fairly simple, and would allow people to use common controllers such as Xbox 360 controller, PS3 controller (without crappy virtual button mappings), GameStop controller, (and my personal favorite) the OnLive Bluetooth Controller. It should also allow people to use joysticks with the app (this may require root and some tweaking of /system/usr/keylayout/ files to map the joysticks properly, depending on the controller), which I can imagine would be very nice. Here's some example code, the full documentation rests in the MotionEvent API pages. http://blog.sagaoftherealms.net/?p=161
Mar 28, 2012 incarnate link
The keyboard support has serious problems. I cannot be sure because of a hardware issue, or if it's a Vendetta bug, but I am assuming it's a hardware bug.

That sounds like a hardware issue. What kind of keyboard is this? We tested with the first Transformer (TF101) as well as some other Android devices with keyboards (a netbook form-factor device we have that isn't well known).

On a related matter, does Vendetta support Android's controller API that was introduced in 3.1?

Yes, we support the joystick API. The stick must be plugged in prior to starting the game, as Android does not currently support the API for native activities (which we use by default, for potential performance benefits). If the stick is plugged in prior to runtime, we detect the presence and offer the user the option of a java activity. It's then up to the user to configure the gamepad or stick to their needs, using the Options -> Controllers interface (which is not exactly a pleasant interface, at present, but works).

We've tested it with the Xbox 360 controller and a handful of others. Anything that registers with the API (be it bluetooth or USB) should theoretically work, although we haven't tested with bluetooth cases.