0

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 ?

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.

Gamesha
  • 11
  • 4

1 Answers1

4

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"] />
yogeshhkumarr
  • 306
  • 1
  • 16
  • Thanks for the quick reply, but I need to use the hard keyboard input to track key events using onKeyDown method in Activity class and perform a separate task. – Gamesha Sep 20 '12 at 11:19
  • You can any-time enable-disable using InputManager. Refer to this post http://stackoverflow.com/a/10670357/1022003 – yogeshhkumarr Sep 20 '12 at 11:42
  • Thanks yogeshhkumarr, this post was helpful. – Gamesha Sep 21 '12 at 06:01
  • I m facing the same issue in my current project when i need to work with softKeyboard as well as a Barcode Scanner (hardkeyboard). All is working fine with kitkat version. but in Lollipop version soft keyboard is not opening for Edittext. – Suresh Sharma Mar 21 '16 at 07:50