問題描述
我已將 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模板網!