Make sure space bar is always available on numeric pad

1.6k views Asked by At

I'm developing an app that lets users enter numbers and spaces in a TextView, so I'm using input.setRawInputType(Configuration.KEYBOARD_12KEY so the user has the nice and convenient numpad. However on some devices the numeric pad doesn't have a spacebar !

How do I make sure my users always have the ability to enter spaces along with numbers in a convenient way?

I thought on building my own numpad using fragments, but that feels just too rough and bumpy.

1

There are 1 answers

1
CommonsWare On BEST ANSWER

However on some devices the numeric pad doesn't have a spacebar !

A 12-key keypad historically has never had a spacebar. You might wish to look at a device that has a 12-key keypad, such as a non-touchscreen "touch-tone" phone.

(sheesh, I feel old...)

However, the decision of what keys to show is up to the developers of the input method editor (soft keyboard). Your request of a 12-key keypad is a hint, not a demand, and the definition of "12-key keypad" is up to those developers.

How do I make sure my users always have the ability to enter spaces along with numbers in a convenient way?

Technically, you can't, in terms of an EditText. Again, that is up to the input method editor developers, not you. You can increase your odds by requesting an alphanumeric keypad, as those traditionally have had spacebars.

You can create your own data entry button pad, or use an EditText but also add some button in your UI for adding a space to the EditText at the current text cursor location.