目前,我正在为Android设计自定义键盘。这就是现在的样子: Keyboard
但是,退格键和输入键仅在上半部分按下时键入。按下半部分的退格键会输入“6”。按下半部分的回车键会输入“=”。
我可以更改什么,以便当按下该键的任何位置时退格键和输入键将起作用?
键盘XML:
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="12%p"
android:horizontalGap="0px"
android:verticalGap="0px"
android:keyHeight="50dp">
<Row>
<Key android:codes="120" android:keyLabel="x" android:keyEdgeFlags="left"/>
<Key android:codes="2" android:keyLabel="x²"/>
<Key android:codes="94" android:keyLabel="^"/>
<Key android:codes="4" android:keyLabel="π" android:horizontalGap="4%p"/>
<Key android:codes="47" android:keyLabel="/"/>
<Key android:codes="42" android:keyLabel="*"/>
<Key android:codes="45" android:keyLabel="-"/>
<Key android:codes="43" android:keyLabel="+" android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="40" android:keyLabel="(" android:keyEdgeFlags="left"/>
<Key android:codes="41" android:keyLabel=")"/>
<Key android:codes="11" android:keyLabel="√"/>
<Key android:codes="33" android:keyLabel="!" android:horizontalGap="4%p"/>
<Key android:codes="55" android:keyLabel="7"/>
<Key android:codes="56" android:keyLabel="8"/>
<Key android:codes="57" android:keyLabel="9"/>
<Key android:codes="-5" android:keyLabel="⌫" android:keyHeight="100dp" android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="17" android:keyLabel="log" android:keyEdgeFlags="left" android:keyWidth="23.9%p"/>
<Key android:codes="18" android:keyLabel="ln" android:keyWidth="23.9%p"/>
<Key android:codes="52" android:keyLabel="4" android:horizontalGap="4%p"/>
<Key android:codes="53" android:keyLabel="5"/>
<Key android:codes="54" android:keyLabel="6" android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="22" android:keyLabel="10ˣ" android:keyEdgeFlags="left" android:keyWidth="23.9%p"/>
<Key android:codes="23" android:keyLabel="eˣ" android:keyWidth="23.9%p"/>
<Key android:codes="49" android:keyLabel="1" android:horizontalGap="4%p"/>
<Key android:codes="50" android:keyLabel="2"/>
<Key android:codes="51" android:keyLabel="3"/>
<Key android:codes="-4" android:keyLabel="⏎" android:keyHeight="100dp" android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="28" android:keyLabel="ABC" android:keyEdgeFlags="left" android:keyWidth="23.9%p"/>
<Key android:codes="29" android:keyLabel="TRIG" android:keyWidth="23.9%p"/>
<Key android:codes="48" android:keyLabel="0" android:horizontalGap="4%p"/>
<Key android:codes="46" android:keyLabel="."/>
<Key android:codes="61" android:keyLabel="=" android:keyEdgeFlags="right"/>
</Row>
</Keyboard>