I've upgraded the SDK tools to revision 20 (from 18) and since the upgrade, the emulator doesn't seem to accept input from laptop's keyboard. But only using the emulator's own 'soft' keyboard (that appears when an input field is focused).
I've tried reinstalling the SDK tools (and the whole SDK for that matter), uninstalled and reinstalled Eclipse Android plugins, re-created emulator devices. But none of that seem to help and its driving me mad. Its hopeless to key-in using a laptop's trackpad.
Has anyone encountered this problem?
To enable this setting go to Android Studio -> Tools -> Android -> AVD Manager. Click on the edit button for the desired emulator. Scroll to the very bottom of the advanced settings and check “Enable keyboard input”.
By default, the soft keyboard may not appear on the emulator. If you want to test with the soft keyboard, be sure to open up the Android Virtual Device Manager ( Tools => Android => AVD Manager ) and uncheck "Enable Keyboard Input" for your emulator. Now restart the emulator.
Open Android Virtual Device Manager. Click the 'Pencil icon' align with the selected Emulator. (A dialog will popup) Select Show Advance Settings button. Find 'Enable Keyboard Input' and ensure it's selected.
Update
As of SDK rev 21 the Android Virtual Device Manager has an improved UI which resolves this issue. I have highlighted some of the more important configuration settings below:
If you notice that the soft (screen-based) main keys Back
, Home
, etc. are missing from your emulator you can set hw.mainKeys=no
to enable them.
Original answer
Even though the developer documentation says keyboard support is enabled by default it doesn't seem to be that way in SDK rev 20. I explicitly enabled keyboard support in my emulator's config.ini file and that worked!
Add: hw.keyboard=yes
To: ~/.android/avd/<emulator-device-name>.avd/config.ini
Similarly, add hw.dPad=yes
if you wish to use the arrow-keys to navigate the application list.
Reference: http://developer.android.com/tools/devices/managing-avds-cmdline.html#hardwareopts
On Mac OS and Linux you can edit all of your emulator configurations with one Terminal command:
for f in ~/.android/avd/*.avd/config.ini; do echo 'hw.keyboard=yes' >> "$f"; done
On a related note, if your tablet emulator is missing the BACK/HOME buttons, try selecting WXGA800 as the Built-in skin in the AVD editor:
Or by manually setting the skin in config.ini:
skin.name=WXGA800 skin.path=platforms/android-16/skins/WXGA800
(example is for API 16)
Confirmed. I had the same problem after upgrading to Tools version 20. I had to Edit the AVD to add an option as follows:
This will add a property hw.keyboard=yes in config.ini file for the AVD.
You also have to set hw.mainKeys = yes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With