Android 模拟器不接受键盘输入 - SDK 工具 20 版 [英] Android emulator doesn't take keyboard input - SDK tools rev 20

查看:22
本文介绍了Android 模拟器不接受键盘输入 - SDK 工具 20 版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 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 Android 插件,重新创建模拟器设备.但这些似乎都没有帮助,这让我发疯.使用笔记本电脑的触控板输入是没有希望的.

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 rev 21 开始,Android 虚拟设备管理器改进了 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:

如果您发现模拟器中缺少软(基于屏幕的)主键 BackHome 等,您可以设置 hw.mainKeys=no 启用它们.

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 rev 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:

for f in ~/.android/avd/*.avd/config.ini;做 echo 'hw.keyboard=yes' >>"$f";完成

在相关说明中,如果您的平板电脑模拟器缺少 BACK/HOME 按钮,请尝试在 AVD 编辑器中选择 WXGA800 作为内置外观:

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)

这篇关于Android 模拟器不接受键盘输入 - SDK 工具 20 版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆