符号的Android密钥代码

时间:2016-11-08 12:34:37

标签: xamarin xamarin.android xamarin.forms

我正在Xamarin Android中使用手动键盘开发应用程序。我的手动键盘由0-9的键和一些特殊字符组成 - ,$,#,@ ..通过搜索表格,我得到了数字键码。

我的代码如下所述:

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

<Row>
<Key android:codes="8" android:keyLabel="1" android:keyEdgeFlags="left" />
<Key android:codes="9" android:keyLabel="2"/>
<Key android:codes="10" android:keyLabel="3"/>
<Key android:codes="11" android:keyLabel="4"/>
<Key android:codes="12" android:keyLabel="5"/>
<Key android:codes="13" android:keyLabel="6"/>
<Key android:codes="14" android:keyLabel="7"/>
<Key android:codes="15" android:keyLabel="8"/>
<Key android:codes="16" android:keyLabel="9"/>
<Key android:codes="7" android:keyLabel="0" android:keyEdgeFlags="right" />
</Row>

<Row android:rowEdgeFlags="bottom">
<Key android:codes="56" android:keyIcon="@drawable/sym_keyboard_done" android:keyWidth="15%p" android:keyEdgeFlags="left" android:horizontalGap="10%p"/>
<Key android:codes="40" android:keyLabel="l"/>
<Key android:codes="44" android:keyLabel="p"/>
<Key android:codes="47" android:keyLabel="s"/>
<Key android:codes="109" android:keyLabel="-"/>
<Key android:codes="109" android:keyLabel="@"/>
<Key android:codes="67" android:keyIcon="@drawable/sym_keyboard_delete" android:keyWidth="15%p" android:keyEdgeFlags="right"  android:isRepeatable="true"/>
<Key android:codes="66" android:keyIcon="@drawable/sym_keyboard_return" android:keyWidth="15%p" android:keyEdgeFlags="right"/>
</Row>

我想知道特殊字符的android:code值,@,主要是。

1 个答案:

答案 0 :(得分:1)

HID键盘和键盘页面:

HID Usage   HID Usage Name  LKC Linux Key Code Name Version AKC Android Key Code Name   Notes
~~~
0x07 0x001f Keyboard 2 and @    0x0003  KEY_2   1.6 0x0009  KEYCODE_2
~~~
0x07 0x002d Keyboard - and _    0x000c  KEY_MINUS   1.6 0x0045  KEYCODE_MINUS   1
~~~

参考:https://source.android.com/devices/input/keyboard-devices.html