0

I'm having an issue while building a custom keyboard for my android app. I'm able to create rows and keys in the xml file, and I'm already provided of the classes that I need to implement it on my EditText: anyway I don't succeed in assigning certain values to keys.

For example, I can't assign the char ':' to one of the keys: when I excecute the app and I try to press it, it doesn't display anything in the EditText... while it works for, e.g., numbers.

Any solution?

<Row>
....
<Key android:codes="51"    android:keyLabel="3" /> //working
<Key android:codes="58"    android:keyLabel=":" /> //not working
</Row>
gorlux
  • 25
  • 4

2 Answers2

0

try using the html code instead:

<Key android:codes="58"    android:keyLabel="&#58;" />
mihail
  • 2,173
  • 19
  • 31
0

The html approach looks simpler, but if you find that you are trying to use characters that are not in the standard android fonts (e.g. cube root, some superscripts and subscript characters) then you might consider using a custom font like DejaVuSans.ttf

Information on how to use a custom font can be found here :

Android - Using Custom Font

Community
  • 1
  • 1
IanB
  • 3,489
  • 1
  • 20
  • 24
  • you mean a simple ':' doesnt exist in standard android font? – gorlux Jul 07 '13 at 15:22
  • No I didn't say that. To display the colon have you tried just using a unicode string - e.g. "\u003A" ? I haven't used this in relation to Edit Text but I use this approach regularly in Java/ Android – IanB Jul 07 '13 at 16:35