問(wèn)題描述
我已將 SDK 工具升級(jí)到修訂版 20(從 18 版),升級(jí)后,模擬器似乎不接受來(lái)自筆記本電腦鍵盤(pán)的輸入.但只能使用模擬器自己的軟"鍵盤(pán)(當(dāng)輸入字段被聚焦時(shí)出現(xiàn)).
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 工具(以及整個(gè) SDK),卸載并重新安裝 Eclipse Android 插件,重新創(chuàng)建模擬器設(shè)備.但這些似乎都沒(méi)有幫助,它讓我發(fā)瘋.使用筆記本電腦的觸控板鍵入是沒(méi)有希望的.
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.
有人遇到過(guò)這個(gè)問(wèn)題嗎?
Has anyone encountered this problem?
推薦答案
更新
從 SDK rev 21 開(kāi)始,Android 虛擬設(shè)備管理器具有改進(jìn)的 UI,可以解決此問(wèn)題.我在下面突出顯示了一些更重要的配置設(shè)置:
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:
如果您發(fā)現(xiàn)模擬器中缺少軟(基于屏幕的)主鍵 Back
、Home
等,您可以設(shè)置 hw.mainKeys=no
來(lái)啟用它們.
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.
原答案
盡管開(kāi)發(fā)人員文檔說(shuō)默認(rèn)啟用鍵盤(pán)支持,但在 SDK rev 20 中似乎并非如此.我在模擬器的 config.ini 文件中明確啟用了鍵盤(pán)支持并且有效!
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/
同樣,如果您希望使用箭頭鍵導(dǎo)航應(yīng)用程序列表,請(qǐng)?zhí)砑?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 上,您可以使用一個(gè)終端命令編輯所有模擬器配置:
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";完成
在相關(guān)說(shuō)明中,如果您的平板電腦模擬器缺少 BACK/HOME 按鈕,請(qǐng)嘗試在 AVD 編輯器中選擇 WXGA800 作為內(nèi)置皮膚:
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:
或者通過(guò)在 config.ini 中手動(dòng)設(shè)置皮膚:
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)
這篇關(guān)于Android 模擬器不接受鍵盤(pán)輸入 - SDK 工具 rev 20的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!