在Android中禁用硬键盘输入的EditText [英] Disable hard keyboard input for EditText in Android
问题描述
我是新来的Android,我需要设置的EditText仅使用软键盘输入。它不应该显示我输入使用硬keyboard.is这种可能的任何文字?
I'm new to android and I need to set a EditText to use soft keyboard input only. It should not display any text that I type using the hard keyboard.is this possible ?
更新: 我用的是硬键盘输入使用的onkeydown在Activity类的方法来跟踪关键事件,并执行一个单独的任务,问题是当一个领域的EditText集中,它显示什么都关键我$ P $使用硬键盘pssed。我要避免这一点,只让软键盘输入到特定的EditText字段并使用硬键盘输入到一个不同的任务。
Update: I use the hard keyboard input to track key events using onKeyDown method in Activity class and perform a separate task, problem comes when a EditText field is focused, it displays what ever the key I pressed using the hard keyboard. I need to avoid this and let only soft keyboard inputs into a particular EditText field and use the hard keyboard input to a different task.
推荐答案
根据您的需要,你可以在Android清单文件中设置键盘设置。
According to your need, you can set keyboard settings in Android Manifest File.
<uses-configuration android:reqFiveWayNav=["true" | "false"]
android:reqHardKeyboard=["true" | "false"]
android:reqKeyboardType=["undefined" | "nokeys" | "qwerty" |
"twelvekey"]
android:reqNavigation=["undefined" | "nonav" | "dpad" |
"trackball" | "wheel"]
android:reqTouchScreen=["undefined" | "notouch" | "stylus" |
"finger"] />
这篇关于在Android中禁用硬键盘输入的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!