I want to run/test Android apps on the Android emulator and I want to type using my PC keyboard, as it lets me type and test faster. When I use the emulator though, it only accepts input from the native Android (on-screen) keyboard. How can I enable my PC keyboard for use within the Android emulator?
I had the same issue after upgrading the developer tools (v20.0.0v2012...). All of a sudden none of my android virtual devices would accept any input from my physical PC/Mac keyboard.
This is how I fixed it:
- Eclipse >
- Select your virtual device and click
Keyboard Supportthen click
- Edit its value to
- Now you have to click off onto another item in the list, like "Abtract LCD Density" or something. This seems to make the UI keep the "yes" change.
My other AVDs that don't have this "keyboard support" hardware property added do NOT accept my physical keyboard input.
Please try the following settings. My environment (Target: Android 4.0.3 - API Level 15) successful.
AVD - Edit - Hardware: - New... - Keyboard support - yes
AVD - Edit - Hardware: - New... - Keyboard lid support - no
You need to change the config.ini file in your .android directory. This file is found under the main hard drive directory. From there, open the avd file and you will see a list of virtual devices. Open the desired device and then open the config.ini in notepad. Then copy this text: "hw.keyboard = yes" (minus the quotes) and then save and close. The next time you open your emulator, you should be able to use the keyboard.
You can also open up the hardware-qemu.ini file in the same directory as the config.ini and then you can see a list of all the hardware options. Change the hw.keyboard from "no" to "yes".
Hope this helps!
This answer is for those who built the emulator from source (i.e. Following instructions from source.android.com). You need to modify a property in the following file:
In the following section of that file change the default value from no to yes:
# Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/>
Then rebuild (using make). At least this worked for me.
I had this issue despite having the correct configuration, and realized that the actual problem was that the focus was on the emulator control buttons windows, as reported in this issue.
To check if this is your problem, see if pressing space actually presses one of those buttons, and if pressing tab moves the highlight focus square between elements in the emulator controls. If that is the problem, then you should be able to work around it as follows:
- Select the extended controls (The "..." button in the emulator controls)
- Change to any item in the extended controls window by clicking
- Close the extended controls window
The focus should now return to the main Android emulator window, not the emulator controls, and key presses should go to Android apps.
As a few have indicated here, the PC keyboard should be enabled for the AVD Emulator instances. Judging by what the emulator page on Android Developer says about key commands and such, it does not appear there is a way to enable/disable PC keyboard usage within the SDK. Your best bet is re-installing the SDK then, and try again.
Try Ctrl + F11 or NumPad 7. That should enable your keyboard, unless is disabled from somewhere else.
If you are using
Visual Studio 2010, you can enable
Keyboard Support as follows:
- Close your AVD
- In VS2010, go to
Tools > Start Android Emulator Manager
- Select the
AVD Namethat you want to add
Keyboard Supportfor, then click the
- In the
Hardwarearea, click the
- In the
Keyboard support, then click the
Propertyis added to the
Hardwarelist. Change the
- Click the
protected by Community♦ Jan 16 '13 at 7:21
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?