Reputation: 873
How to force keyboard to show only English(UK). I need this because i want to prevent user to enter other languages like Arabic, chines etc., And if user using Arabic keyboard then i need to force my app (keyboard) to use English(UK) keyboard.
kindly help me to achieve this. Thanks in advance.
Upvotes: 5
Views: 2157
Reputation: 6547
I think it would be better to filter the input keys. Even if you will be able to force English keyboard that doesn't force users to use only English letters because they can also long press a character or even have a another hardware keyboard (non-english).
So, you should listen to some events
onTextChanged
for example and reject all characters that you do not want to accept.
Upvotes: 4
Reputation: 2834
You should never force the user to do that kind of thing. If you detect a non english keyboard, just put a pop up asking them to use an english keyboard, and give them the steps to do so ! As Thomas said, you should get answers if you're sure about doing so into the post he linked
Upvotes: 1