keypad to uppercase

Smee

Well-Known Member
Licensed User
Longtime User
Is there a way to show the keypad in uppercase letters only?

i have tried this method posted by Erel but it does not seem to work. No matter what number i plug in

http://www.b4x.com/forum/basic4android-updates-questions/9799-edittext-capitalization.html#post54300

This is the code i tried to test it with

B4X:
Sub etProdCode_FocusChanged (HasFocus As Boolean)

Log(etProdCode.InputType)       
etProdCode.InputType= Bit.Or(etProdCode.INPUT_TYPE_TEXT, 8192)
Log(etProdCode.InputType)

If HasFocus =True Then
   etProdCode.Text=""
End If
End Sub

the log results are

1) 524289
2) 8193

Any ideas?
 
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
Thanks Klaus


I did lookup those codes and tried many of them. 8192 was the last one that i had tried

I was actually using 4096

public static final int TYPE_TEXT_FLAG_CAP_CHARACTERS
Since: API Level 3

Flag for TYPE_CLASS_TEXT: capitalize all characters. Overrides TYPE_TEXT_FLAG_CAP_WORDS and TYPE_TEXT_FLAG_CAP_SENTENCES. This value is explicitly defined to be the same as CAP_MODE_CHARACTERS.
Constant Value: 4096 (0x00001000)
 
Upvote 0

Smee

Well-Known Member
Licensed User
Longtime User
Sorry Klaus it is working.

I had mistakenely initialised the text box earlier which seems to have stopped it working properly


Edit:

As an aside how do you add 2 of them together would it be anded or ored?

or just add the 2 values

Joe
 
Last edited:
Upvote 0
Top