Added new number pad (#81)

* Added new number pad
* keyActionFlags="noKeyPreview" added
* Displayed period + comma keys as Gboard & added symbols key
* Added currency hint for phone in portrait mode on "%" key
* Added ≠ ≈ on the = key and ± on the + key
* Moved spacebar above backspace key for phones in landscape mode
This commit is contained in:
BlackyHawky 2023-08-26 08:57:46 +02:00 committed by GitHub
parent 350eb6d66a
commit 77c0a5b4f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 777 additions and 4 deletions

View file

@ -42,6 +42,7 @@ public final class KeyboardId {
public static final int MODE_DATE = 6;
public static final int MODE_TIME = 7;
public static final int MODE_DATETIME = 8;
public static final int MODE_NUMPAD = 9;
public static final int ELEMENT_ALPHABET = 0;
public static final int ELEMENT_ALPHABET_MANUAL_SHIFTED = 1;
@ -71,6 +72,7 @@ public final class KeyboardId {
public static final int ELEMENT_EMOJI_CATEGORY15 = 25;
public static final int ELEMENT_EMOJI_CATEGORY16 = 26;
public static final int ELEMENT_CLIPBOARD = 27;
public static final int ELEMENT_NUMPAD = 28;
public final RichInputMethodSubtype mSubtype;
public final int mWidth;
@ -259,6 +261,7 @@ public final class KeyboardId {
case ELEMENT_EMOJI_CATEGORY15: return "emojiCategory15";
case ELEMENT_EMOJI_CATEGORY16: return "emojiCategory16";
case ELEMENT_CLIPBOARD: return "clipboard";
case ELEMENT_NUMPAD: return "numpad";
default: return null;
}
}
@ -274,6 +277,7 @@ public final class KeyboardId {
case MODE_DATE: return "date";
case MODE_TIME: return "time";
case MODE_DATETIME: return "datetime";
case MODE_NUMPAD: return "numpad";
default: return null;
}
}

View file

@ -181,6 +181,9 @@ public final class KeyboardLayoutSet {
keyboardLayoutSetElementId = KeyboardId.ELEMENT_PHONE;
}
break;
case KeyboardId.MODE_NUMPAD:
keyboardLayoutSetElementId = KeyboardId.ELEMENT_NUMPAD;
break;
case KeyboardId.MODE_NUMBER:
case KeyboardId.MODE_DATE:
case KeyboardId.MODE_TIME:

View file

@ -347,6 +347,14 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
mClipboardHistoryView.setVisibility(View.VISIBLE);
}
@Override
public void setNumpadKeyboard() {
if (DEBUG_ACTION) {
Log.d(TAG, "setNumpadKeyboard");
}
setKeyboard(KeyboardId.ELEMENT_NUMPAD, KeyboardSwitchState.OTHER);
}
public enum KeyboardSwitchState {
HIDDEN(-1),
SYMBOLS_SHIFTED(KeyboardId.ELEMENT_SYMBOLS_SHIFTED),

View file

@ -55,6 +55,9 @@ public final class KeyboardCodesSet {
"key_unspecified",
"key_clipboard",
"key_alpha_from_clipboard",
"key_numpad",
"key_alphaNumpad",
"key_symbolNumpad",
"key_start_onehanded",
"key_stop_onehanded",
"key_switch_onehanded"
@ -80,6 +83,9 @@ public final class KeyboardCodesSet {
Constants.CODE_UNSPECIFIED,
Constants.CODE_CLIPBOARD,
Constants.CODE_ALPHA_FROM_CLIPBOARD,
Constants.CODE_NUMPAD,
Constants.CODE_ALPHA_FROM_NUMPAD,
Constants.CODE_SYMBOL_FROM_NUMPAD,
Constants.CODE_START_ONE_HANDED_MODE,
Constants.CODE_STOP_ONE_HANDED_MODE,
Constants.CODE_SWITCH_ONE_HANDED_MODE

View file

@ -62,6 +62,7 @@ public final class KeyboardIconsSet {
public static final String NAME_CLIPBOARD_ACTION_KEY = "clipboard_action_key";
public static final String NAME_CLIPBOARD_NORMAL_KEY = "clipboard_normal_key";
public static final String NAME_CLEAR_CLIPBOARD_KEY = "clear_clipboard_key";
public static final String NAME_NUMPAD_KEY = "numpad_key";
public static final String NAME_START_ONEHANDED_KEY = "start_onehanded_mode_key";
public static final String NAME_STOP_ONEHANDED_KEY = "stop_onehanded_mode_key";
public static final String NAME_SWITCH_ONEHANDED_KEY = "switch_onehanded_key";
@ -98,6 +99,7 @@ public final class KeyboardIconsSet {
NAME_CLIPBOARD_ACTION_KEY, R.styleable.Keyboard_iconClipboardActionKey,
NAME_CLIPBOARD_NORMAL_KEY, R.styleable.Keyboard_iconClipboardNormalKey,
NAME_CLEAR_CLIPBOARD_KEY, R.styleable.Keyboard_iconClearClipboardKey,
NAME_NUMPAD_KEY, R.styleable.Keyboard_iconNumpadKey,
NAME_START_ONEHANDED_KEY, R.styleable.Keyboard_iconStartOneHandedMode,
NAME_STOP_ONEHANDED_KEY, R.styleable.Keyboard_iconStopOneHandedMode,
NAME_SWITCH_ONEHANDED_KEY, R.styleable.Keyboard_iconSwitchOneHandedMode,

View file

@ -52,6 +52,7 @@ public final class KeyboardState {
void setAlphabetShiftLockShiftedKeyboard();
void setEmojiKeyboard();
void setClipboardKeyboard();
void setNumpadKeyboard();
void setSymbolsKeyboard();
void setSymbolsShiftedKeyboard();
@ -90,6 +91,7 @@ public final class KeyboardState {
private static final int MODE_SYMBOLS = 1;
private static final int MODE_EMOJI = 2;
private static final int MODE_CLIPBOARD = 3;
private static final int MODE_NUMPAD = 4;
private int mMode = MODE_ALPHABET;
private AlphabetShiftState mAlphabetShiftState = new AlphabetShiftState();
private boolean mIsSymbolShifted;
@ -124,6 +126,9 @@ public final class KeyboardState {
if (mMode == MODE_CLIPBOARD) {
return "CLIPBOARD";
}
if (mMode == MODE_NUMPAD) {
return "NUMPAD";
}
return "SYMBOLS_" + shiftModeToString(mShiftMode);
}
}
@ -200,6 +205,10 @@ public final class KeyboardState {
setClipboardKeyboard();
return;
}
if (state.mMode == MODE_NUMPAD) {
setNumpadKeyboard();
return;
}
// Symbol mode
if (state.mShiftMode == MANUAL_SHIFT) {
setSymbolsShiftedKeyboard();
@ -373,6 +382,19 @@ public final class KeyboardState {
mSwitchActions.setClipboardKeyboard();
}
private void setNumpadKeyboard() {
if (DEBUG_INTERNAL_ACTION) {
Log.d(TAG, "setNumpadKeyboard");
}
mMode = MODE_NUMPAD;
mRecapitalizeMode = RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE;
// Remember caps lock mode and reset alphabet shift state.
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
mAlphabetShiftState.setShiftLocked(false);
mSwitchActions.setNumpadKeyboard();
}
private void setOneHandedModeEnabled(boolean enabled) {
if (DEBUG_INTERNAL_ACTION) {
Log.d(TAG, "setOneHandedModeEnabled");
@ -687,7 +709,7 @@ public final class KeyboardState {
}
break;
case SWITCH_STATE_SYMBOL_BEGIN:
if (mMode == MODE_EMOJI || mMode == MODE_CLIPBOARD) {
if (mMode == MODE_EMOJI || mMode == MODE_CLIPBOARD || mMode == MODE_NUMPAD) {
// When in the Emoji keyboard or clipboard one, we don't want to switch back to the main layout even
// after the user hits an emoji letter followed by an enter or a space.
break;
@ -728,6 +750,12 @@ public final class KeyboardState {
}
} else if (code == Constants.CODE_ALPHA_FROM_CLIPBOARD) {
setAlphabetKeyboard(autoCapsFlags, recapitalizeMode);
} else if (code == Constants.CODE_NUMPAD) {
setNumpadKeyboard();
} else if (code == Constants.CODE_ALPHA_FROM_NUMPAD) {
setAlphabetKeyboard(autoCapsFlags, recapitalizeMode);
} else if (code == Constants.CODE_SYMBOL_FROM_NUMPAD) {
setSymbolsKeyboard();
} else if (code == Constants.CODE_START_ONE_HANDED_MODE) {
setOneHandedModeEnabled(true);
} else if (code == Constants.CODE_STOP_ONE_HANDED_MODE) {

View file

@ -262,6 +262,7 @@ public final class KeyboardTextsTable {
/* 178: 0 */ "keyspec_clipboard_normal_key",
/* 179: 0 */ "keyspec_start_onehanded_mode",
/* 180: 0 */ "keyspec_language_switch",
/* 181: 0 */ "keyspec_numpad_key",
};
private static final String EMPTY = "";
@ -491,6 +492,7 @@ public final class KeyboardTextsTable {
/* keyspec_clipboard_normal_key */ "!icon/clipboard_normal_key|!code/key_clipboard",
/* keyspec_start_onehanded_mode */ "!icon/start_onehanded_mode_key|!code/key_start_onehanded",
/* keyspec_language_switch */ "!icon/language_switch_key|!code/key_language_switch",
/* keyspec_numpad_key */ "!icon/numpad_key|!code/key_numpad",
};
/* Locale af: Afrikaans */
@ -4263,7 +4265,7 @@ public final class KeyboardTextsTable {
private static final Object[] LOCALES_AND_TEXTS = {
// "locale", TEXT_ARRAY, /* numberOfNonNullText/lengthOf_TEXT_ARRAY localeName */
"DEFAULT", TEXTS_DEFAULT, /* 181/181 DEFAULT */
"DEFAULT", TEXTS_DEFAULT, /* 182/182 DEFAULT */
"af" , TEXTS_af, /* 7/ 13 Afrikaans */
"ar" , TEXTS_ar, /* 55/110 Arabic */
"az" , TEXTS_az, /* 11/ 18 Azerbaijani */

View file

@ -250,8 +250,11 @@ public final class Constants {
public static final int CODE_START_ONE_HANDED_MODE = -17;
public static final int CODE_STOP_ONE_HANDED_MODE = -18;
public static final int CODE_SWITCH_ONE_HANDED_MODE = -19;
public static final int CODE_NUMPAD = -20;
public static final int CODE_ALPHA_FROM_NUMPAD = -21;
public static final int CODE_SYMBOL_FROM_NUMPAD = -22;
// Code value representing the code is not specified.
public static final int CODE_UNSPECIFIED = -20;
public static final int CODE_UNSPECIFIED = -23;
public static boolean isLetterCode(final int code) {
return code >= CODE_SPACE;
@ -282,6 +285,9 @@ public final class Constants {
case CODE_START_ONE_HANDED_MODE: return "startOneHandedMode";
case CODE_STOP_ONE_HANDED_MODE: return "stopOneHandedMode";
case CODE_SWITCH_ONE_HANDED_MODE: return "switchOneHandedMode";
case CODE_NUMPAD: return "numpad";
case CODE_ALPHA_FROM_NUMPAD: return "alphaNumpad";
case CODE_SYMBOL_FROM_NUMPAD: return "symbolNumpad";
default:
if (code < CODE_SPACE) return String.format("\\u%02X", code);
if (code < 0x100) return String.format("%c", code);

View file

@ -717,6 +717,18 @@ public final class InputLogic {
// Note: Switching back from clipboard keyboard to the main keyboard is being
// handled in {@link KeyboardState#onEvent(Event,int)}.
break;
case Constants.CODE_NUMPAD:
// Note: Switching Numpad keyboard is being handled in
// {@link KeyboardState#onEvent(Event,int)}.
break;
case Constants.CODE_ALPHA_FROM_NUMPAD:
// Note: Switching back from Numpad keyboard to the main keyboard is being
// handled in {@link KeyboardState#onEvent(Event,int)}.
break;
case Constants.CODE_SYMBOL_FROM_NUMPAD:
// Note: Switching back from Numpad keyboard to the symbol keyboard is being
// handled in {@link KeyboardState#onEvent(Event,int)}.
break;
case Constants.CODE_SHIFT_ENTER:
final Event tmpEvent = Event.createSoftwareKeypressEvent(Constants.CODE_ENTER,
event.getMKeyCode(), event.getMX(), event.getMY(), event.isKeyRepeat());

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -302,6 +302,7 @@
<attr name="iconStartOneHandedMode" format="reference" />
<attr name="iconStopOneHandedMode" format="reference" />
<attr name="iconSwitchOneHandedMode" format="reference" />
<attr name="iconNumpadKey" format="reference" />
</declare-styleable>
<declare-styleable name="Keyboard_GridRows">
@ -498,6 +499,7 @@
<enum name="emojiCategory14" value="24" />
<enum name="emojiCategory15" value="25" />
<enum name="emojiCategory16" value="26" />
<enum name="numpad" value="28" />
</attr>
<!-- This should be aligned with Keyboard.themeId and
{@link org.dslul.openboard.inputmethod.keyboard.KeyboardTheme#THEME_ID_ICS} etc. -->
@ -586,6 +588,7 @@
<enum name="emojiCategory14" value="24" />
<enum name="emojiCategory15" value="25" />
<enum name="emojiCategory16" value="26" />
<enum name="numpad" value="28" />
</attr>
<attr name="elementKeyboard" format="reference"/>
<!-- Enable proximity characters correction. Disabled by default. -->

View file

@ -44,5 +44,6 @@
<item name="iconStartOneHandedMode">@drawable/sym_keyboard_start_onehanded_holo_dark</item>
<item name="iconStopOneHandedMode">@drawable/sym_keyboard_stop_onehanded_holo_dark</item>
<item name="iconSwitchOneHandedMode">@drawable/sym_keyboard_switch_onehanded_holo_dark</item>
<item name="iconNumpadKey">@drawable/sym_keyboard_numpad_key_holo_dark</item>
</style>
</resources>

View file

@ -49,5 +49,6 @@
<item name="iconStartOneHandedMode">@drawable/sym_keyboard_start_onehanded_lxx_light</item>
<item name="iconStopOneHandedMode">@drawable/sym_keyboard_stop_onehanded_lxx_light</item>
<item name="iconSwitchOneHandedMode">@drawable/sym_keyboard_switch_onehanded_lxx_light</item>
<item name="iconNumpadKey">@drawable/sym_keyboard_numpad_key_lxx_light</item>
</style>
</resources>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:latin="http://schemas.android.com/apk/res-auto"
latin:keyWidth="16%p"
latin:touchPositionCorrectionData="@array/touch_position_correction_data_default"
>
<include
latin:keyboardLayout="@xml/rows_numpad" />
</Keyboard>

View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:latin="http://schemas.android.com/apk/res-auto"
>
<include
latin:keyboardLayout="@xml/key_styles_common" />
<include
latin:keyboardLayout="@xml/key_styles_number" />
<include
latin:keyboardLayout="@xml/key_styles_currency" />
<!-- First row -->
<Row>
<!-- &#40; "(" LEFT PARENTHESIS SIGN -->
<!-- &#123; "{" LEFT CURLY BRACKET -->
<!-- &#91; "[" LEFT SQUARE BRACKET -->
<Key
latin:keySpec="&#40;"
latin:additionalMoreKeys="&#123;,&#91;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#41; ")" RIGHT PARENTHESIS SIGN -->
<!-- &#125; "}" RIGHT CURLY BRACKET -->
<!-- &#93; "]" RIGHT SQUARE BRACKET -->
<Key
latin:keySpec="&#41;"
latin:additionalMoreKeys="&#125;,&#93;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#58; ":" COLON SIGN -->
<Key
latin:keySpec="&#58;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keySpec="1"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="2"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="3"
latin:keyStyle="numKeyStyle" />
<!-- &#43; "+" PLUS SIGN -->
<!-- &#177; "±" PLUS-MINUS SIGN -->
<Key
latin:keySpec="&#43;"
latin:additionalMoreKeys="&#177;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#45; "-" HYPHEN-MINUS SIGN -->
<!-- &#126; "~" TILDE -->
<Key
latin:keySpec="&#45;"
latin:additionalMoreKeys="&#126;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#32; " " SPACE -->
<Key
latin:keySpec="!icon/space_key_for_number_layout|&#32;"
latin:keyLabelFlags="alignIconToBottom"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview|enableLongPress"
latin:keyWidth="fillRight" />
</Row>
<!-- Second row -->
<Row>
<!-- &#33; "!" EXCLAMATION MARK SIGN -->
<Key
latin:keySpec="&#33;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#63; "?" QUESTION MARK SIGN -->
<Key
latin:keySpec="&#63;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#59; ";" SEMICOLON SIGN -->
<Key
latin:keySpec="&#59;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keySpec="4"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="5"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="6"
latin:keyStyle="numKeyStyle" />
<!-- &#42; "*" ASTERISK SIGN -->
<!-- &#215; "×" MULTIPLICATION SIGN -->
<Key
latin:keySpec="&#42;"
latin:additionalMoreKeys="&#215;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#47; "/" SOLIDUS SIGN -->
<!-- &#247; "÷" DIVISION SIGN -->
<Key
latin:keySpec="&#47;"
latin:additionalMoreKeys="&#247;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:backgroundType="functional"
latin:keyWidth="fillRight" />
</Row>
<!-- Third row -->
<Row>
<!-- &#124; "|" VERTICAL LINE -->
<Key
latin:keySpec="&#124;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keyStyle="currencyKeyStyle"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#38; "&" AMPERSAND -->
<Key
latin:keySpec="&#38;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keySpec="7"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="8"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="9"
latin:keyStyle="numKeyStyle" />
<!-- &#35; "#" NUMBER SIGN -->
<Key
latin:keySpec="&#35;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#37; "%" PERCENT SIGN -->
<!-- &#8240; "‰" PER MILLE SIGN -->
<Key
latin:keySpec="&#37;"
latin:additionalMoreKeys="&#8240;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<!-- Fourth row -->
<Row>
<Key
latin:keyStyle="alphaNumpadKeyStyle"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#60; "<" LESS-THAN SIGN -->
<!-- &#8804; "≤" LESS THAN OR EQUAL TO -->
<Key
latin:keySpec="&#60;"
latin:additionalMoreKeys="&#8804;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#62; ">" GREATER-THAN SIGN -->
<!-- &#8805; "≥" GREATER THAN OR EQUAL TO -->
<Key
latin:keySpec="&#62;"
latin:additionalMoreKeys="&#8805;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#44; "," COMMA SIGN -->
<Key
latin:keySpec="&#44;"
latin:additionalMoreKeys="!text/keyspec_clipboard_normal_key,!text/keyspec_emoji_normal_key,!text/keyspec_language_switch,!text/keyspec_settings"
latin:keyActionFlags="noKeyPreview" />
<Key
latin:keySpec="0"
latin:keyStyle="numKeyStyle" />
<!-- &#46; "." PERIOD SIGN -->
<!-- &#8230; "..." ELLIPSIS SIGN -->
<!-- &#8734; "∞" INFINITY -->
<!-- &#960; "π" GREEK SMALL LETTER PI -->
<!-- &#8730; "√" SQUARE ROOT -->
<!-- &#176; "°" DEGREE SIGN -->
<!-- &#94; "^" CIRCUMFLEX ACCENT -->
<Key
latin:keySpec="&#46;"
latin:additionalMoreKeys="&#8230;,&#8734;,&#960;,&#8730;,&#176;,&#94;"
latin:keyActionFlags="noKeyPreview" />
<!-- &#61; "=" EQUAL SIGN -->
<!-- &#8800; "≠" NOT EQUAL TO -->
<!-- &#8776; "≈" ALMOST EQUAL TO -->
<Key
latin:keySpec="&#61;"
latin:additionalMoreKeys="&#8800;,&#8776;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="17.2%p" />
<Key
latin:keyStyle="symbolNumpadKeyStyle"
latin:backgroundType="functional"
latin:keyWidth="fillRight" />
</Row>
</merge>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:latin="http://schemas.android.com/apk/res-auto"
latin:keyWidth="16.1%p"
latin:touchPositionCorrectionData="@array/touch_position_correction_data_default"
>
<include
latin:keyboardLayout="@xml/rows_numpad" />
</Keyboard>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:latin="http://schemas.android.com/apk/res-auto"
latin:keyWidth="16.1%p"
latin:touchPositionCorrectionData="@array/touch_position_correction_data_default"
>
<include
latin:keyboardLayout="@xml/rows_numpad" />
</Keyboard>

View file

@ -71,6 +71,58 @@
latin:parentStyle="baseForShiftKeyStyle" />
</default>
</switch>
<!-- numpadKeyStyle -->
<switch>
<case latin:keyboardTheme="ICS|KLP|LXXBaseBorder|LXXBase">
<key-style
latin:styleName="numpadKeyStyle"
latin:keySpec="!icon/numpad_key|!code/key_numpad"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</case>
<default>
<key-style
latin:styleName="numpadKeyStyle"
latin:keySpec="!icon/numpad_key|!code/key_numpad"
latin:keyLabelFlags="keepBackgroundAspectRatio"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</default>
</switch>
<!-- alphaNumpadKeyStyle -->
<switch>
<case latin:keyboardTheme="ICS|KLP|LXXBaseBorder|LXXBase">
<key-style
latin:styleName="alphaNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_alpha|!code/key_alphaNumpad"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</case>
<default>
<key-style
latin:styleName="alphaNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_alpha|!code/key_alphaNumpad"
latin:keyLabelFlags="keepBackgroundAspectRatio"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</default>
</switch>
<!-- symbolNumpadKeyStyle -->
<switch>
<case latin:keyboardTheme="ICS|KLP|LXXBaseBorder|LXXBase">
<key-style
latin:styleName="symbolNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_symbol|!code/key_symbolNumpad"
latin:keyActionFlags="noKeyPreview" />
</case>
<default>
<key-style
latin:styleName="symbolNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_symbol|!code/key_symbolNumpad"
latin:keyLabelFlags="keepBackgroundAspectRatio"
latin:keyActionFlags="noKeyPreview" />
</default>
</switch>
<key-style
latin:styleName="deleteKeyStyle"
latin:keySpec="!icon/delete_key|!code/key_delete"

View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:latin="http://schemas.android.com/apk/res-auto"
>
<include
latin:keyboardLayout="@xml/key_styles_common" />
<include
latin:keyboardLayout="@xml/key_styles_number" />
<include
latin:keyboardLayout="@xml/key_styles_currency" />
<!-- First row -->
<Row>
<!-- &#40; "(" LEFT PARENTHESIS SIGN -->
<!-- &#123; "{" LEFT CURLY BRACKET -->
<!-- &#91; "[" LEFT SQUARE BRACKET -->
<Key
latin:keySpec="&#40;"
latin:additionalMoreKeys="&#123;,&#91;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#41; ")" RIGHT PARENTHESIS SIGN -->
<!-- &#125; "}" RIGHT CURLY BRACKET -->
<!-- &#93; "]" RIGHT SQUARE BRACKET -->
<Key
latin:keySpec="&#41;"
latin:additionalMoreKeys="&#125;,&#93;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#58; ":" COLON SIGN -->
<Key
latin:keySpec="&#58;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keySpec="1"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="2"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="3"
latin:keyStyle="numKeyStyle" />
<!-- &#43; "+" PLUS SIGN -->
<!-- &#177; "±" PLUS-MINUS SIGN -->
<Key
latin:keySpec="&#43;"
latin:additionalMoreKeys="&#177;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#45; "-" HYPHEN-MINUS SIGN -->
<!-- &#126; "~" TILDE -->
<Key
latin:keySpec="&#45;"
latin:additionalMoreKeys="&#126;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:backgroundType="functional"
latin:keyWidth="fillRight" />
</Row>
<!-- Second row -->
<Row>
<!-- &#33; "!" EXCLAMATION MARK SIGN -->
<Key
latin:keySpec="&#33;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#63; "?" QUESTION MARK SIGN -->
<Key
latin:keySpec="&#63;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#59; ";" SEMICOLON SIGN -->
<Key
latin:keySpec="&#59;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keySpec="4"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="5"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="6"
latin:keyStyle="numKeyStyle" />
<!-- &#42; "*" ASTERISK SIGN -->
<!-- &#215; "×" MULTIPLICATION SIGN -->
<Key
latin:keySpec="&#42;"
latin:additionalMoreKeys="&#215;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#47; "/" SOLIDUS SIGN -->
<!-- &#247; "÷" DIVISION SIGN -->
<Key
latin:keySpec="&#47;"
latin:additionalMoreKeys="&#247;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<!-- Third row -->
<Row>
<!-- &#124; "|" VERTICAL LINE -->
<Key
latin:keySpec="&#124;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keyStyle="currencyKeyStyle"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#38; "&" AMPERSAND -->
<Key
latin:keySpec="&#38;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<Key
latin:keySpec="7"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="8"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="9"
latin:keyStyle="numKeyStyle" />
<!-- &#35; "#" NUMBER SIGN -->
<Key
latin:keySpec="&#35;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#37; "%" PERCENT SIGN -->
<!-- &#8240; "‰" PER MILLE SIGN -->
<Key
latin:keySpec="&#37;"
latin:additionalMoreKeys="&#8240;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#32; " " SPACE -->
<Key
latin:keySpec="!icon/space_key_for_number_layout|&#32;"
latin:keyLabelFlags="alignIconToBottom"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview|enableLongPress"
latin:keyWidth="fillRight" />
</Row>
<!-- Fourth row -->
<Row>
<Key
latin:keyStyle="alphaNumpadKeyStyle"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#60; "<" LESS-THAN SIGN -->
<!-- &#8804; "≤" LESS THAN OR EQUAL TO -->
<Key
latin:keySpec="&#60;"
latin:additionalMoreKeys="&#8804;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#62; ">" GREATER-THAN SIGN -->
<!-- &#8805; "≥" GREATER THAN OR EQUAL TO -->
<Key
latin:keySpec="&#62;"
latin:additionalMoreKeys="&#8805;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="8.6%p" />
<!-- &#44; "," COMMA SIGN -->
<Key
latin:keySpec="&#44;"
latin:additionalMoreKeys="!text/keyspec_clipboard_normal_key,!text/keyspec_emoji_normal_key,!text/keyspec_language_switch,!text/keyspec_settings"
latin:keyActionFlags="noKeyPreview" />
<Key
latin:keySpec="0"
latin:keyStyle="numKeyStyle" />
<!-- &#46; "." PERIOD SIGN -->
<!-- &#8230; "..." ELLIPSIS SIGN -->
<!-- &#8734; "∞" INFINITY -->
<!-- &#960; "π" GREEK SMALL LETTER PI -->
<!-- &#8730; "√" SQUARE ROOT -->
<!-- &#176; "°" DEGREE SIGN -->
<!-- &#94; "^" CIRCUMFLEX ACCENT -->
<Key
latin:keySpec="&#46;"
latin:additionalMoreKeys="&#8230;,&#8734;,&#960;,&#8730;,&#176;,&#94;"
latin:keyActionFlags="noKeyPreview" />
<!-- &#61; "=" EQUAL SIGN -->
<!-- &#8800; "≠" NOT EQUAL TO -->
<!-- &#8776; "≈" ALMOST EQUAL TO -->
<Key
latin:keySpec="&#61;"
latin:additionalMoreKeys="&#8800;,&#8776;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="17.2%p" />
<Key
latin:keyStyle="symbolNumpadKeyStyle"
latin:backgroundType="functional"
latin:keyWidth="fillRight" />
</Row>
</merge>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:latin="http://schemas.android.com/apk/res-auto"
latin:keyWidth="23.33333%p"
latin:touchPositionCorrectionData="@array/touch_position_correction_data_default"
>
<include
latin:keyboardLayout="@xml/rows_numpad" />
</Keyboard>

View file

@ -95,6 +95,58 @@
latin:backgroundType="functional" />
</default>
</switch>
<!-- numpadKeyStyle -->
<switch>
<case latin:keyboardTheme="ICS|KLP|LXXBaseBorder|LXXBase">
<key-style
latin:styleName="numpadKeyStyle"
latin:keySpec="!icon/numpad_key|!code/key_numpad"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</case>
<default>
<key-style
latin:styleName="numpadKeyStyle"
latin:keySpec="!icon/numpad_key|!code/key_numpad"
latin:keyLabelFlags="keepBackgroundAspectRatio"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</default>
</switch>
<!-- alphaNumpadKeyStyle -->
<switch>
<case latin:keyboardTheme="ICS|KLP|LXXBaseBorder|LXXBase">
<key-style
latin:styleName="alphaNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_alpha|!code/key_alphaNumpad"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</case>
<default>
<key-style
latin:styleName="alphaNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_alpha|!code/key_alphaNumpad"
latin:keyLabelFlags="keepBackgroundAspectRatio"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
</default>
</switch>
<!-- symbolNumpadKeyStyle -->
<switch>
<case latin:keyboardTheme="ICS|KLP|LXXBaseBorder|LXXBase">
<key-style
latin:styleName="symbolNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_symbol|!code/key_symbolNumpad"
latin:keyActionFlags="noKeyPreview" />
</case>
<default>
<key-style
latin:styleName="symbolNumpadKeyStyle"
latin:keySpec="!text/keylabel_to_symbol|!code/key_symbolNumpad"
latin:keyLabelFlags="keepBackgroundAspectRatio"
latin:keyActionFlags="noKeyPreview" />
</default>
</switch>
<include
latin:keyboardLayout="@xml/key_styles_enter" />
<!-- TODO: Currently there is no way to specify icon alignment per theme. -->

View file

@ -40,4 +40,7 @@
<Element
latin:elementName="number"
latin:elementKeyboard="@xml/kbd_number" />
<Element
latin:elementName="numpad"
latin:elementKeyboard="@xml/kbd_numpad" />
</KeyboardLayoutSet>

View file

@ -40,4 +40,7 @@
<Element
latin:elementName="number"
latin:elementKeyboard="@xml/kbd_number" />
<Element
latin:elementName="numpad"
latin:elementKeyboard="@xml/kbd_numpad" />
</KeyboardLayoutSet>

View file

@ -22,7 +22,7 @@
<Key
latin:keySpec="!text/keyspec_comma" />
<Key
latin:keySpec="_" />
latin:keyStyle="numpadKeyStyle" />
<include
latin:keyboardLayout="@xml/key_space_symbols" />
<Key

View file

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:latin="http://schemas.android.com/apk/res-auto"
>
<include
latin:keyboardLayout="@xml/key_styles_common" />
<include
latin:keyboardLayout="@xml/key_styles_number" />
<include
latin:keyboardLayout="@xml/key_styles_currency" />
<!-- First row -->
<Row>
<!-- &#43; "+" PLUS SIGN -->
<!-- &#40; "(" LEFT PARENTHESIS SIGN -->
<!-- &#60; "<" LESS-THAN SIGN -->
<!-- &#177; "±" PLUS-MINUS SIGN -->
<Key
latin:keySpec="&#43;"
latin:keyHintLabel="&#40;"
latin:additionalMoreKeys="&#40;,&#60;,&#177;"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="15%p" />
<Key
latin:keySpec="1"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="2"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="3"
latin:keyStyle="numKeyStyle" />
<!-- &#37; "%" PERCENT SIGN -->
<Key
latin:keySpec="&#37;"
latin:keyStyle="currencyHintStyle"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="fillRight" />
</Row>
<!-- Second row -->
<Row>
<!-- &#45; "-" HYPHEN-MINUS SIGN -->
<!-- &#41; ")" RIGHT PARENTHESIS SIGN -->
<!-- &#62; ">" GREATER-THAN SIGN -->
<!-- &#126; "~" TILDE -->
<Key
latin:keySpec="&#45;"
latin:keyHintLabel="&#41;"
latin:additionalMoreKeys="&#41;,&#62;,&#126;"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="15%p" />
<Key
latin:keySpec="4"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="5"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="6"
latin:keyStyle="numKeyStyle" />
<!-- &#32; " " SPACE -->
<Key
latin:keySpec="!icon/space_key_for_number_layout|&#32;"
latin:keyLabelFlags="alignIconToBottom"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview|enableLongPress"
latin:keyWidth="fillRight" />
</Row>
<!-- Third row -->
<Row>
<!-- &#42; "*" ASTERISK SIGN -->
<!-- &#47; "/" SOLIDUS SIGN -->
<!-- &#215; "×" MULTIPLICATION SIGN -->
<!-- &#247; "÷" DIVISION SIGN -->
<Key
latin:keySpec="&#42;"
latin:keyHintLabel="&#47;"
latin:additionalMoreKeys="&#47;,&#215;,&#247;"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="15%p" />
<Key
latin:keySpec="7"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="8"
latin:keyStyle="numKeyStyle" />
<Key
latin:keySpec="9"
latin:keyStyle="numKeyStyle" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<!-- Fourth row -->
<Row>
<Key
latin:keyStyle="alphaNumpadKeyStyle"
latin:keyWidth="15%p" />
<!-- &#44; "," COMMA SIGN -->
<Key
latin:keySpec="&#44;"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="!text/keyspec_clipboard_normal_key,!text/keyspec_emoji_normal_key,!text/keyspec_language_switch,!text/keyspec_settings"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="10%p" />
<Key
latin:keyStyle="symbolNumpadKeyStyle"
latin:keyWidth="13.33333%p" />
<Key
latin:keySpec="0"
latin:keyStyle="numKeyStyle" />
<!-- &#61; "=" EQUAL SIGN -->
<!-- &#8800; "≠" NOT EQUAL TO -->
<!-- &#8776; "≈" ALMOST EQUAL TO -->
<Key
latin:keySpec="&#61;"
latin:keyHintLabel="&#8800;"
latin:additionalMoreKeys="&#8800;,&#8776;"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="13.33333%p" />
<!-- &#46; "." PERIOD SIGN -->
<!-- &#8230; "..." ELLIPSIS SIGN -->
<!-- &#8734; "∞" INFINITY -->
<!-- &#960; "π" GREEK SMALL LETTER PI -->
<!-- &#8730; "√" SQUARE ROOT -->
<!-- &#176; "°" DEGREE SIGN -->
<!-- &#94; "^" CIRCUMFLEX ACCENT -->
<Key
latin:keySpec="&#46;"
latin:additionalMoreKeys="&#8230;,&#8734;,&#960;,&#8730;,&#176;,&#94;"
latin:backgroundType="functional"
latin:keyActionFlags="noKeyPreview"
latin:keyWidth="10%p" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
</merge>

View file

@ -264,6 +264,7 @@
<string name="keyspec_clipboard_normal_key">!icon/clipboard_normal_key|!code/key_clipboard</string>
<string name="keyspec_start_onehanded_mode">!icon/start_onehanded_mode_key|!code/key_start_onehanded</string>
<string name="keyspec_language_switch">!icon/language_switch_key|!code/key_language_switch</string>
<string name="keyspec_numpad_key">!icon/numpad_key|!code/key_numpad</string>
<string name="label_go_key">!string/label_go_key</string>
<string name="label_send_key">!string/label_send_key</string>
<string name="label_next_key">!string/label_next_key</string>