Android - How to disable certain keys in virtual keyboard

11,645

How to disable certain keys (say number/symbol keys) in Android virtual keyboard?

You can't, sorry. After all, the input method editor may not have "keys" in the first place.

Specifically I want user can't input a double quote ( " ) character when virtual keyboard is showed up when user focus on a standard android EditText widget.

Then you will have to block the input at the EditText, by means of an InputFilter, as is described here: How do I use InputFilter to limit characters in an EditText in Android?

Share:
11,645
henrywibowo
Author by

henrywibowo

Updated on June 28, 2022

Comments

  • henrywibowo
    henrywibowo over 1 year

    How to disable certain keys (say number/symbol keys) in Android virtual keyboard?

    Specifically I want user can't input a double quote ( " ) character when virtual keyboard is showed up when user focus on a standard android EditText widget.

  • Sergi Juanola
    Sergi Juanola over 11 years
    I think he talks about specific keys. Text but without ". He also talks about "standard" android, so he might be using already inputType defined EditTexts
  • henrywibowo
    henrywibowo over 11 years
    yes, i use the attribute inputType, but i just can't find the suitable inputType that only for letters and numbers. But it's done now with edittext's attribute "android:digits" Thank you anyway :-)
  • Shail Adi
    Shail Adi over 8 years
    @Commonware, how do we disable the keys completely, i.e. the keys do not generate any key event at all. It just sits, there in the softkeyboard, as a disabled button.
  • Shail Adi
    Shail Adi over 8 years
    In my note 2 device : my files> create folder> ; now go for special symbols and see; some of the symbols are disabled.