Jump to content

Teclado personalizado - Android

Recommended Posts


Boas pessoal,

Tou a iniciar-me em apps android e tou com um problema. Queria criar um teclado personalizado. Para isso crio um o teclado como o seguinte por exemplo:

<[u]Keyboard[/u] xmlns:android="http://schemas.android.com/apk/res/android"
   android:keyHeight="10%p" >

       <Key android:codes="55"    android:keyLabel="7" android:keyEdgeFlags="left" />
       <Key android:codes="56"    android:keyLabel="8" />
       <Key android:codes="57"    android:keyLabel="9" />
       <Key android:codes="65"    android:keyLabel="A" android:horizontalGap="6.25%p" />
       <Key android:codes="66"    android:keyLabel="B" />
       <Key android:codes="-5"    android:keyIcon="@drawable/sym_keyboard_delete" android:isRepeatable="true" android:horizontalGap="6.25%p" />
       <Key android:codes="55006" android:keyLabel="CLR" android:keyEdgeFlags="right"/>
       <Key android:codes="52"    android:keyLabel="4" android:keyEdgeFlags="left"  />
       <Key android:codes="53"    android:keyLabel="5" />
       <Key android:codes="54"    android:keyLabel="6" />
       <Key android:codes="67"    android:keyLabel="C" android:horizontalGap="6.25%p" />
       <Key android:codes="68"    android:keyLabel="D" />
       <Key android:codes="55002" android:keyIcon="@drawable/sym_keyboard_left" android:isRepeatable="true" android:horizontalGap="6.25%p" />
       <Key android:codes="55003" android:keyIcon="@drawable/sym_keyboard_right" android:isRepeatable="true" android:keyEdgeFlags="right" />
       <Key android:codes="49"    android:keyLabel="1"  android:keyEdgeFlags="left" />
       <Key android:codes="50"    android:keyLabel="2" />
       <Key android:codes="51"    android:keyLabel="3" />
       <Key android:codes="69"    android:keyLabel="E" android:horizontalGap="6.25%p" />
       <Key android:codes="70"    android:keyLabel="F" />
       <Key android:codes="55001" android:keyIcon="@drawable/sym_keyboard_allleft" android:horizontalGap="6.25%p" />
       <Key android:codes="55004" android:keyIcon="@drawable/sym_keyboard_allright" android:keyEdgeFlags="right" />
       <Key android:codes="48"    android:keyLabel="0" android:keyWidth="25%p" android:horizontalGap="6.25%p" android:keyEdgeFlags="left" />
       <Key android:codes="-3"    android:keyIcon="@drawable/sym_keyboard_done" android:keyWidth="25%p" android:horizontalGap="12.50%p" />
       <Key android:codes="55000" android:keyLabel="PREV" android:horizontalGap="6.25%p" />
       <Key android:codes="55005" android:keyLabel="NEXT" android:keyEdgeFlags="right" />

Acontece que os "codes" deviam pertencer à gama unicodes descrita em http://www.utf8-chartable.de/unicode-utf8-table.pl?number=1024&utf8=-&unicodeinhtml=dec mas isso não acontece. Alguém já fez algo deste género?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.