我已将 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:
如果您发现模拟器中缺少软(基于屏幕的)主键 Back
、Home
等,您可以设置 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/
同样,如果您希望使用箭头键导航应用程序列表,请添加 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 工具 rev 20的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!