2013-02-02 16 views
5

Android için bir Giriş yöntemi editörü yazarken, haritayı değiştirmek için ne yapmam gerekecek, android değiştirmekten başka bazı unicode karakterleri kabul ediyorum: keyLabel (örneğin, bana Malayalam karakterini giriş olarak eşleştirecek şekilde : 0D00 - 0DFF)Android IME hangi Unicode'u kabul ediyor

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" 
     android:horizontalGap="0px" 
     android:keyHeight="@dimen/key_height" 
     android:keyWidth="10%p" 
     android:verticalGap="0px" > 

     <Row> 
      <Key 
       android:codes="45" 
       android:keyEdgeFlags="left" 
       android:keyLabel="q" 
       android:popupCharacters="@string/hello" 
       android:popupKeyboard="@xml/qwerty"/> 
      <Key 
       android:codes="51" 
       android:keyLabel="w" /> 
      <Key 
       android:codes="33" 
       android:keyLabel="e" /> 
      <Key 
       android:codes="46" 
       android:keyLabel="r" /> 
      <Key 
       android:codes="48" 
       android:keyLabel="t" /> 
      <Key 
       android:codes="53" 
       android:keyLabel="y" /> 
      <Key 
       android:codes="49" 
       android:keyLabel="u" /> 
      <Key 
       android:codes="37" 
       android:keyLabel="i" /> 
      <Key 
       android:codes="43" 
       android:keyLabel="o" /> 
      <Key 
       android:codes="44" 
       android:keyEdgeFlags="right" 
       android:keyLabel="p" /> 
     </Row> 
     <Row> 
      <Key 
       android:codes="29" 
       android:horizontalGap="5%p" 
       android:keyEdgeFlags="left" 
       android:keyLabel="a" /> 
      <Key 
       android:codes="47" 
       android:keyLabel="s" /> 
      <Key 
       android:codes="32" 
       android:keyLabel="d" /> 
      <Key 
       android:codes="34" 
       android:keyLabel="f" /> 
      <Key 
       android:codes="35" 
       android:keyLabel="g" /> 
      <Key 
       android:codes="36" 
       android:keyLabel="h" /> 

      <Key 
       android:codes="38" 
       android:keyLabel="J" /> 
      <Key 
       android:codes="49" 
       android:keyLabel="K" /> 

      <Key 
       android:codes="40" 
       android:keyEdgeFlags="right" 
       android:keyLabel="l" /> 
     </Row> 
     <Row> 
      <Key 
       android:codes="60"    
       android:keyEdgeFlags="left" 
       android:keyIcon="@drawable/sym_keyboard_shift" 
       android:iconPreview="@drawable/sym_keyboard_shift" 
       android:isModifier="true" 
       android:isSticky="true" 
       android:keyWidth="15%p" 
       android:keyLabel="shift" /> 
      <Key 
       android:codes="54" 
       android:keyLabel="z" /> 
      <Key 
       android:codes="52" 
       android:keyLabel="x" /> 
      <Key 
       android:codes="31" 
       android:keyLabel="c" /> 
      <Key 
       android:codes="50" 
       android:keyLabel="v" /> 
      <Key 
       android:codes="30" 
       android:keyLabel="b" /> 
      <Key 
       android:codes="42" 
       android:keyLabel="n" /> 
      <Key 
       android:codes="41" 
       android:keyLabel="m" /> 
      <Key 
       android:codes="67" 
       android:isRepeatable="true" 
       android:keyEdgeFlags="right" 
       android:keyIcon="@drawable/sym_keyboard_delete" 
       android:keyWidth="15%p" /> 
     </Row> 
     <Row android:rowEdgeFlags="bottom" > 
      <Key 
       android:codes="-3" 
       android:keyEdgeFlags="left" 
       android:keyIcon="@drawable/sym_keyboard_done" 
       android:keyWidth="20%p" /> 
      <Key 
       android:codes="-2" 
       android:keyLabel="123" 
       android:keyWidth="15%p" /> 
      <Key 
       android:codes="62" 
       android:isRepeatable="true" 
       android:keyIcon="@drawable/sym_keyboard_space" 
       android:keyWidth="30%p" /> 
      <Key 
       android:codes="46,55" 
       android:keyLabel=". ," 
       android:keyWidth="15%p" /> 
      <Key 
       android:codes="10" 
       android:keyEdgeFlags="right" 
       android:keyIcon="@drawable/sym_keyboard_return" 
       android:keyWidth="20%p" /> 
     </Row> 

    </Keyboard> 
+0

herhangi bir çözüm bulmak mı? – Rajkiran

cevap

2

Bu eski bir soru olduğunu biliyorum, ama ben bu yüzden bunun için görünebilir diğerleri için buradan bir tane olacak gerektiğinde cevabı bulamadım. documentation göre

: Keyboard.Key en (android.inputmethodservice.Keyboard.Key) robot: kodları XML özniteliktir:

Unicode değeri veya virgülle ayrılmış değerler bu anahtar çıkışlar.

'\;' kullanarak bir dize değeri olabilir unicode karakteri için '\ n' veya '\ uxxxx' gibi karakterlerden kaçmak için; "100" gibi bir tam sayı, olabilir.

'\;' kullanarak nasıl çalışacağını anlayamadım ancak birini yapabilirsiniz:

veya

  • (2) yerine ile kaçan '\;' 0x önekini belirtin ör. karakter അ Malayalam Harf bir U + 0D05 için 0x0D05

Örnekler:

(1)

<Key android:codes="3333" android:keyLabel="\u0D05"/> 

(2)

<Key android:codes="0x0D05" android:keyLabel="\u0D05"/> 
İlgili konular