Android模拟器并不需要键盘输入 - SDK工具修订版20并不、修订版、模拟器、键盘输入

2023-09-11 12:51:11 作者:快递哥哥,

我已经升级SDK工具修订20(18),并自升级,模拟器似乎并没有接受来自笔记本电脑的键盘输入。但是,只有使用模拟器自己的软键盘(当一个输入字段集中出现)。

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).

我试着重新安装SDK工具(和整个SDK的这个问题),卸载和重新安装的Eclipse的Andr​​oid插件,重新创建仿真设备。但是,没有,似乎有助于其快把我逼疯了。它无望关键在使用笔记本的触控板。

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?

推荐答案

更新

随着SDK的转速21的Andr​​oid虚拟设备管理器有一个改进的UI从而解决了这个问题。我强调了以下一些比较重要的配置设置:

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:

如果您发现软(屏幕为主)主键返回首页等缺失从你的模拟器可以设置 hw.mainKeys =没有启用它们。

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.

原来的答复

尽管开发者文档说键盘的支持是默认打开它似乎并没有被这种方式在SDK转速20.我在模拟器的config.ini文件,并明确启用键盘支持的工作!

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!

地址: hw.keyboard = YES

要:〜/ .android / AVD /<仿真设备,名称> .avd / config.ini文件

同样,添加 hw.dPad = YES 如果你希望使用箭头键导航的应用程序列表。

Similarly, add hw.dPad=yes if you wish to use the arrow-keys to navigate the application list.

参考:http://developer.android.com/tools/devices/managing-avds-cmdline.html#hardwareopts

在Mac OS和Linux可以编辑所有的仿真器配置,一台终端的命令:

On Mac OS and Linux you can edit all of your emulator configurations with one Terminal command:

对于f在〜/ .android / AVD / * AVD / config.ini文件。做回声hw.k​​eyboard = YES'>> $ F;完成

在一个相关的说明,如果你的平板电脑模拟器缺少BACK / HOME按钮,尝试选择 WXGA800 作为内置皮肤的AVD编辑器:

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:

或通过手动设置皮肤的config.ini文件:

Or by manually setting the skin in config.ini:

skin.name=WXGA800
skin.path=platforms/android-16/skins/WXGA800

(例如是API 16)

(example is for API 16)