Redo meta key management, now several meta keys can be pressed/latched/locked at once for different results. Some miscellaneous fixes. Add license.
This commit is contained in:
@@ -21,31 +21,35 @@ package cfpi_fpsi.eu.titanboard;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
import android.os.Build;
|
||||
import android.os.Vibrator;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
// TODO: Implement long-click for extra keys.
|
||||
// TODO: Implement auto-correct.
|
||||
// TODO: Implement auto-caps.
|
||||
// TODO: Implement language switcher.
|
||||
// TODO: Implement device recognition and a keymap picking based on it.
|
||||
// TODO: Make preferences accessible and saveable.
|
||||
|
||||
public class IME extends InputMethodService {
|
||||
private MetaKeyManager mMetaKeyManager;
|
||||
private Keymap mKeymap;
|
||||
|
||||
private LinearLayout mInputView;
|
||||
private Vibrator mVibrator;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// TODO, which already has been done anyways, is to support multiple phone models by using
|
||||
// the "ro.vendor.build.fingerprint" property. The goal is to support at least the other two
|
||||
// Unihertz phones: the Pocket and the Slim. However, as I don't have them, it'll be guesswork.
|
||||
// Sym key support is already implemented.
|
||||
mKeymap = new Keymap(getResources().getXml(R.xml.keymap_titan));
|
||||
// Ideally, detect the device, but for now, load all available keymaps.
|
||||
|
||||
mKeymap = new Keymap(getResources().getXml(R.xml.keymap_titan_pl));
|
||||
mVibrator = (Vibrator) getBaseContext().getSystemService(VIBRATOR_SERVICE);
|
||||
mMetaKeyManager = new MetaKeyManager(mVibrator);
|
||||
}
|
||||
@@ -84,6 +88,7 @@ public class IME extends InputMethodService {
|
||||
return false;
|
||||
case KeyEvent.KEYCODE_DEL:
|
||||
case KeyEvent.KEYCODE_ENTER:
|
||||
mMetaKeyManager.adjustMetaStateAfterKeypress();
|
||||
return false;
|
||||
case KeyEvent.KEYCODE_SPACE:
|
||||
conn.commitText(" ", 1);
|
||||
@@ -96,8 +101,9 @@ public class IME extends InputMethodService {
|
||||
return false;
|
||||
}
|
||||
|
||||
conn.commitText(getKey(keyCode), 1);
|
||||
conn.commitText(key, 1);
|
||||
mMetaKeyManager.adjustMetaStateAfterKeypress();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -120,49 +126,50 @@ public class IME extends InputMethodService {
|
||||
}
|
||||
|
||||
private String getKey(int keyCode) {
|
||||
if (metaKeyActive(MetaKeyManager.MetaKey.ALT)) {
|
||||
return mKeymap.getValueAlt(keyCode);
|
||||
} else if (metaKeyActive(MetaKeyManager.MetaKey.SHIFT)) {
|
||||
return mKeymap.getValueShift(keyCode);
|
||||
} else if (metaKeyActive(MetaKeyManager.MetaKey.SYM)) {
|
||||
return mKeymap.getValueSym(keyCode);
|
||||
} else {
|
||||
return mKeymap.getValue(keyCode);
|
||||
if (mMetaKeyManager.getAlt().isActive()) {
|
||||
return mKeymap.getKeyAlt(keyCode);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean metaKeyActive(MetaKeyManager.MetaKey key) {
|
||||
return mMetaKeyManager.getMetaKeyPressed() == key
|
||||
|| mMetaKeyManager.getMetaKeyLatched() == key
|
||||
|| mMetaKeyManager.getMetaKeyLocked() == key;
|
||||
if (mMetaKeyManager.getSym().isActive() && mMetaKeyManager.getShift().isActive()) {
|
||||
return mKeymap.getKeyShiftSym(keyCode);
|
||||
}
|
||||
|
||||
if (mMetaKeyManager.getSym().isActive()) {
|
||||
return mKeymap.getKeySym(keyCode);
|
||||
}
|
||||
|
||||
if (mMetaKeyManager.getShift().isActive()) {
|
||||
return mKeymap.getKeyShift(keyCode);
|
||||
}
|
||||
|
||||
// Nothing active.
|
||||
return mKeymap.getKey(keyCode);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void updateMetaStateTextView() {
|
||||
TextView stateView = mInputView.findViewById(R.id.state);
|
||||
TextView shiftStateView = mInputView.findViewById(R.id.state_shift);
|
||||
TextView altStateView = mInputView.findViewById(R.id.state_alt);
|
||||
TextView symStateView = mInputView.findViewById(R.id.state_sym);
|
||||
|
||||
if (mMetaKeyManager.getMetaKeyLatched() == MetaKeyManager.MetaKey.ALT) {
|
||||
stateView.setText("#?");
|
||||
} else if (mMetaKeyManager.getMetaKeyLatched() == MetaKeyManager.MetaKey.SHIFT) {
|
||||
stateView.setText("Aa");
|
||||
} else {
|
||||
stateView.setText("aa");
|
||||
shiftStateView.setText(getStringForMetaKey(
|
||||
mMetaKeyManager.getShift(), "aa", "Aa", "AA"));
|
||||
altStateView.setText(getStringForMetaKey(
|
||||
mMetaKeyManager.getAlt(), "..", "#?", "#!"));
|
||||
symStateView.setText(getStringForMetaKey(
|
||||
mMetaKeyManager.getSym(), "..", "þπ", "ÞΩ"));
|
||||
}
|
||||
|
||||
private String getStringForMetaKey(MetaKeyManager.MetaKey key, String normal, String latched, String pressed) {
|
||||
if (key.isLatched()) {
|
||||
return latched;
|
||||
}
|
||||
|
||||
if (mMetaKeyManager.getMetaKeyPressed() == MetaKeyManager.MetaKey.ALT
|
||||
|| mMetaKeyManager.getMetaKeyLocked() == MetaKeyManager.MetaKey.ALT) {
|
||||
stateView.setText("#!");
|
||||
} else if (mMetaKeyManager.getMetaKeyPressed() == MetaKeyManager.MetaKey.SHIFT
|
||||
|| mMetaKeyManager.getMetaKeyLocked() == MetaKeyManager.MetaKey.SHIFT) {
|
||||
stateView.setText("AA");
|
||||
if (key.isLocked() || key.isPressed()) {
|
||||
return pressed;
|
||||
}
|
||||
|
||||
if (mMetaKeyManager.getMetaKeyLocked() != MetaKeyManager.MetaKey.NONE
|
||||
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
stateView.setTextAppearance(R.style.KeyboardStateLocked);
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
stateView.setTextAppearance(R.style.KeyboardState);
|
||||
}
|
||||
return normal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.HashMap;
|
||||
public class Keymap extends HashMap<Integer, String[]> {
|
||||
public Keymap(XmlPullParser parser) {
|
||||
int code = 0;
|
||||
String value = null, valueAlt = null, valueSym = null;
|
||||
String none = null, shift = null, alt = null, sym = null, shiftSym = null;
|
||||
|
||||
try {
|
||||
while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
@@ -40,19 +40,25 @@ public class Keymap extends HashMap<Integer, String[]> {
|
||||
case "code":
|
||||
code = Integer.parseInt(parser.getAttributeValue(i));
|
||||
break;
|
||||
case "value":
|
||||
value = parser.getAttributeValue(i);
|
||||
case "none":
|
||||
none = parser.getAttributeValue(i);
|
||||
break;
|
||||
case "valueAlt":
|
||||
valueAlt = parser.getAttributeValue(i);
|
||||
case "shift":
|
||||
shift = parser.getAttributeValue(i);
|
||||
break;
|
||||
case "valueSym":
|
||||
valueSym = parser.getAttributeValue(i);
|
||||
case "alt":
|
||||
alt = parser.getAttributeValue(i);
|
||||
break;
|
||||
case "sym":
|
||||
sym = parser.getAttributeValue(i);
|
||||
break;
|
||||
case "shiftSym":
|
||||
shiftSym = parser.getAttributeValue(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (type == XmlPullParser.END_TAG && parser.getName().equals("key")) {
|
||||
put(code, new String[]{value, valueAlt, valueSym});
|
||||
put(code, new String[]{none, shift, alt, sym, shiftSym});
|
||||
}
|
||||
|
||||
parser.next();
|
||||
@@ -62,23 +68,28 @@ public class Keymap extends HashMap<Integer, String[]> {
|
||||
}
|
||||
}
|
||||
|
||||
public String getValue(int keyCode) {
|
||||
public String getKey(int keyCode) {
|
||||
String[] values = get(keyCode);
|
||||
return values != null ? values[0] : null;
|
||||
}
|
||||
|
||||
public String getValueAlt(int keyCode) {
|
||||
public String getKeyShift(int keyCode) {
|
||||
String[] values = get(keyCode);
|
||||
return values != null ? values[1] : null;
|
||||
}
|
||||
|
||||
public String getValueShift(int keyCode) {
|
||||
String[] values = get(keyCode);
|
||||
return values != null ? values[0].toUpperCase() : null;
|
||||
}
|
||||
|
||||
public String getValueSym(int keyCode) {
|
||||
public String getKeyAlt(int keyCode) {
|
||||
String[] values = get(keyCode);
|
||||
return values != null ? values[2] : null;
|
||||
}
|
||||
|
||||
public String getKeySym(int keyCode) {
|
||||
String[] values = get(keyCode);
|
||||
return values != null ? values[3] : null;
|
||||
}
|
||||
|
||||
public String getKeyShiftSym(int keyCode) {
|
||||
String[] values = get(keyCode);
|
||||
return values != null ? values[4] : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* An input method for the Unihertz Titan/physical keyboard phones
|
||||
* Copyright (C) 2024 Emil Kosz
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package cfpi_fpsi.eu.titanboard;
|
||||
|
||||
public class KeymapManager {
|
||||
}
|
||||
@@ -23,11 +23,9 @@ import android.os.Vibrator;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
public class MetaKeyManager {
|
||||
private MetaKey mMetaKeyPressed = MetaKey.NONE;
|
||||
private MetaKey mMetaKeyLatched = MetaKey.NONE;
|
||||
private MetaKey mMetaKeyLocked = MetaKey.NONE;
|
||||
private boolean mMetaKeyUsed = false;
|
||||
private long mKeyUpTime;
|
||||
public MetaKey mShift = new MetaKey();
|
||||
public MetaKey mAlt = new MetaKey();
|
||||
public MetaKey mSym = new MetaKey();
|
||||
|
||||
private Vibrator mVibrator;
|
||||
|
||||
@@ -39,14 +37,14 @@ public class MetaKeyManager {
|
||||
switch (keyCode) {
|
||||
case KeyEvent.KEYCODE_ALT_LEFT:
|
||||
case KeyEvent.KEYCODE_ALT_RIGHT:
|
||||
updateMetaKeyDown(MetaKey.ALT, event);
|
||||
updateMetaKeyDown(mAlt, event);
|
||||
break;
|
||||
case KeyEvent.KEYCODE_SHIFT_LEFT:
|
||||
case KeyEvent.KEYCODE_SHIFT_RIGHT:
|
||||
updateMetaKeyDown(MetaKey.SHIFT, event);
|
||||
updateMetaKeyDown(mShift, event);
|
||||
break;
|
||||
case KeyEvent.KEYCODE_SYM:
|
||||
updateMetaKeyDown(MetaKey.SYM, event);
|
||||
updateMetaKeyDown(mSym, event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -55,24 +53,31 @@ public class MetaKeyManager {
|
||||
|
||||
void updateMetaKeyDown(MetaKey key, KeyEvent event) {
|
||||
// Perhaps this function should be renamed to something...
|
||||
mMetaKeyUsed = false;
|
||||
mMetaKeyPressed = key;
|
||||
mMetaKeyLatched = mMetaKeyLocked != MetaKey.NONE ? mMetaKeyLocked : mMetaKeyLatched;
|
||||
mMetaKeyLocked = MetaKey.NONE;
|
||||
key.setUsed(false);
|
||||
key.setPressed(true);
|
||||
key.setLatched(key.isLocked() ? key.isLocked() : key.isLatched());
|
||||
key.setLocked(false);
|
||||
|
||||
if (mShift.isPressed() && mAlt.isPressed()) {
|
||||
mSym.setLatched(!mSym.isLatched());
|
||||
mShift.setUsed(true);
|
||||
mAlt.setUsed(true);
|
||||
mVibrator.vibrate(20);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateMetaStateUp(int keyCode, KeyEvent event) {
|
||||
switch (keyCode) {
|
||||
case KeyEvent.KEYCODE_ALT_LEFT:
|
||||
case KeyEvent.KEYCODE_ALT_RIGHT:
|
||||
updateMetaKeyUp(MetaKey.ALT, event);
|
||||
updateMetaKeyUp(mAlt, event);
|
||||
break;
|
||||
case KeyEvent.KEYCODE_SHIFT_LEFT:
|
||||
case KeyEvent.KEYCODE_SHIFT_RIGHT:
|
||||
updateMetaKeyUp(MetaKey.SHIFT, event);
|
||||
updateMetaKeyUp(mShift, event);
|
||||
break;
|
||||
case KeyEvent.KEYCODE_SYM:
|
||||
updateMetaKeyUp(MetaKey.SYM, event);
|
||||
updateMetaKeyUp(mSym, event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -80,59 +85,114 @@ public class MetaKeyManager {
|
||||
}
|
||||
|
||||
public void updateMetaKeyUp(MetaKey key, KeyEvent event) {
|
||||
if (event.getEventTime() - mKeyUpTime < 400 && mMetaKeyLatched == key) {
|
||||
mMetaKeyLocked = key;
|
||||
if (event.getEventTime() - key.getKeyUpTime() < 400) {
|
||||
key.setLocked(true);
|
||||
mVibrator.vibrate(30);
|
||||
}
|
||||
|
||||
mKeyUpTime = event.getEventTime();
|
||||
mMetaKeyPressed = MetaKey.NONE;
|
||||
if (mMetaKeyLatched == MetaKey.NONE && mMetaKeyLocked == MetaKey.NONE && !mMetaKeyUsed) {
|
||||
mMetaKeyLatched = key;
|
||||
} else {
|
||||
mMetaKeyLatched = MetaKey.NONE;
|
||||
}
|
||||
key.setKeyUpTime(event.getEventTime());
|
||||
key.setPressed(false);
|
||||
|
||||
key.setLatched(!key.isLatched() && !key.isLocked() && !key.isUsed());
|
||||
}
|
||||
|
||||
public void adjustMetaStateAfterKeypress() {
|
||||
if (mMetaKeyLatched != MetaKey.NONE) {
|
||||
mMetaKeyLatched = MetaKey.NONE;
|
||||
mMetaKeyUsed = false;
|
||||
adjustMetaStateHelper(mShift);
|
||||
adjustMetaStateHelper(mAlt);
|
||||
adjustMetaStateHelper(mSym);
|
||||
}
|
||||
|
||||
public void adjustMetaStateHelper(MetaKey key) {
|
||||
if (key.isLatched()) {
|
||||
key.setLatched(false);
|
||||
key.setUsed(false);
|
||||
}
|
||||
|
||||
if (mMetaKeyPressed != MetaKey.NONE) {
|
||||
mMetaKeyUsed = true;
|
||||
if (key.isPressed()) {
|
||||
key.setUsed(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void resetMetaKeyState() {
|
||||
mMetaKeyPressed = MetaKey.NONE;
|
||||
mMetaKeyLatched = MetaKey.NONE;
|
||||
mMetaKeyLocked = MetaKey.NONE;
|
||||
mMetaKeyUsed = false;
|
||||
mShift.resetState();
|
||||
mAlt.resetState();
|
||||
mSym.resetState();
|
||||
}
|
||||
|
||||
public void setMetaKeyLatched(MetaKey key) {
|
||||
resetMetaKeyState();
|
||||
mMetaKeyLatched = key;
|
||||
public MetaKey getShift() {
|
||||
return mShift;
|
||||
}
|
||||
|
||||
public MetaKey getMetaKeyPressed() {
|
||||
return mMetaKeyPressed;
|
||||
public MetaKey getAlt() {
|
||||
return mAlt;
|
||||
}
|
||||
|
||||
public MetaKey getMetaKeyLatched() {
|
||||
return mMetaKeyLatched;
|
||||
public MetaKey getSym() {
|
||||
return mSym;
|
||||
}
|
||||
|
||||
public MetaKey getMetaKeyLocked() {
|
||||
return mMetaKeyLocked;
|
||||
}
|
||||
public static class MetaKey {
|
||||
private boolean mPressed = false;
|
||||
private boolean mLatched = false;
|
||||
private boolean mLocked = false;
|
||||
private boolean mUsed = false;
|
||||
private long mKeyUpTime;
|
||||
|
||||
public enum MetaKey {
|
||||
ALT,
|
||||
NONE,
|
||||
SHIFT,
|
||||
SYM
|
||||
public void resetState() {
|
||||
setPressed(false);
|
||||
setLatched(false);
|
||||
setLocked(false);
|
||||
setUsed(false);
|
||||
}
|
||||
|
||||
public void setPressed(boolean state) {
|
||||
mPressed = state;
|
||||
}
|
||||
|
||||
public void setLatched(boolean state) {
|
||||
mLatched = state;
|
||||
}
|
||||
|
||||
public void setLocked(boolean state) {
|
||||
mLocked = state;
|
||||
}
|
||||
|
||||
public void setUsed(boolean state) {
|
||||
mUsed = state;
|
||||
}
|
||||
|
||||
public void setKeyUpTime(long time) {
|
||||
mKeyUpTime = time;
|
||||
}
|
||||
|
||||
public boolean isPressed() {
|
||||
return mPressed;
|
||||
}
|
||||
|
||||
public boolean isLatched() {
|
||||
return mLatched;
|
||||
}
|
||||
|
||||
public boolean isLocked() {
|
||||
return mLocked;
|
||||
}
|
||||
|
||||
public boolean isUsed() {
|
||||
return mUsed;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return isPressed() || isLocked() || isLatched();
|
||||
}
|
||||
|
||||
public long getKeyUpTime() {
|
||||
return mKeyUpTime;
|
||||
}
|
||||
|
||||
public enum MetaKeyType {
|
||||
ALT,
|
||||
SHIFT,
|
||||
SYM
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,29 +10,36 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/candidates"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/state"
|
||||
android:id="@+id/state_shift"
|
||||
style="@style/KeyboardState"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="aa"
|
||||
android:typeface="normal"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
<TextView
|
||||
android:id="@+id/state_alt"
|
||||
style="@style/KeyboardState"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=".."
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" />
|
||||
</HorizontalScrollView>
|
||||
<TextView
|
||||
android:id="@+id/state_sym"
|
||||
style="@style/KeyboardState"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:text=".."
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardExtraButton"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="PL" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -52,87 +59,80 @@
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="<" />
|
||||
android:text="^"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=">" />
|
||||
android:text="~"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="^" />
|
||||
android:text="\\"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="~" />
|
||||
android:text="="
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="\\" />
|
||||
android:text="&"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="=" />
|
||||
android:text=";"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="&" />
|
||||
android:text="<"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=";" />
|
||||
android:text=">"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="|" />
|
||||
android:text="|"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="[" />
|
||||
android:text="["
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="]" />
|
||||
android:text="]"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="{" />
|
||||
android:text="{"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="}" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="←" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="↑" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="↓" />
|
||||
|
||||
<Button
|
||||
style="@style/KeyboardKey"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="→" />
|
||||
android:text="}"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
@@ -4,31 +4,65 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<CheckBox
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Automatic capitalization" />
|
||||
|
||||
<CheckBox
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Automatic periods" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Autocorrect" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Time between clicks to detect double click" />
|
||||
android:text="Languages:" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar3"
|
||||
<Switch
|
||||
android:id="@+id/switch1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="English" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="German" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="French" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Russian" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Polish" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Greek" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Settings:" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Auto-caps" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch8"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Auto-period" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -18,7 +18,20 @@
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:textAlignment">center</item>
|
||||
<item name="android:typeface">monospace</item>
|
||||
<item name="android:layout_width">72dp</item>
|
||||
<item name="android:layout_width">40dp</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
</style>
|
||||
|
||||
<style name="KeyboardExtraButton">
|
||||
<item name="android:background">@drawable/key</item>
|
||||
<item name="android:textColor">#FFF</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:layout_marginLeft">1dp</item>
|
||||
<item name="android:layout_marginRight">1dp</item>
|
||||
<item name="android:layout_marginTop">2dp</item>
|
||||
<item name="android:layout_marginBottom">2dp</item>
|
||||
<item name="android:layout_width">48dp</item>
|
||||
<item name="android:layout_gravity">right</item>
|
||||
</style>
|
||||
|
||||
<style name="KeyboardStateLocked" parent="KeyboardState">
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keymap>
|
||||
<key
|
||||
code="29"
|
||||
value="a"
|
||||
valueAlt="@"
|
||||
valueSym="ą" />
|
||||
<key
|
||||
code="30"
|
||||
value="b"
|
||||
valueAlt="7" />
|
||||
<key
|
||||
code="31"
|
||||
value="c"
|
||||
valueAlt=","
|
||||
valueSym="ć" />
|
||||
<key
|
||||
code="32"
|
||||
value="d"
|
||||
valueAlt=""" />
|
||||
<key
|
||||
code="33"
|
||||
value="e"
|
||||
valueAlt="_"
|
||||
valueSym="ę" />
|
||||
<key
|
||||
code="34"
|
||||
value="f"
|
||||
valueAlt="+" />
|
||||
<key
|
||||
code="35"
|
||||
value="g"
|
||||
valueAlt="*" />
|
||||
<key
|
||||
code="36"
|
||||
value="h"
|
||||
valueAlt="#" />
|
||||
<key
|
||||
code="37"
|
||||
value="i"
|
||||
valueAlt="2" />
|
||||
<key
|
||||
code="38"
|
||||
value="j"
|
||||
valueAlt="4" />
|
||||
<key
|
||||
code="39"
|
||||
value="k"
|
||||
valueAlt="5" />
|
||||
<key
|
||||
code="40"
|
||||
value="l"
|
||||
valueAlt="6"
|
||||
valueSym="ł" />
|
||||
<key
|
||||
code="41"
|
||||
value="m"
|
||||
valueAlt="9" />
|
||||
<key
|
||||
code="42"
|
||||
value="n"
|
||||
valueAlt="8"
|
||||
valueSym="ń" />
|
||||
<key
|
||||
code="43"
|
||||
value="o"
|
||||
valueAlt="3"
|
||||
valueSym="ó" />
|
||||
<key
|
||||
code="44"
|
||||
value="p"
|
||||
valueAlt="0" />
|
||||
<key
|
||||
code="45"
|
||||
value="q"
|
||||
valueAlt=":" />
|
||||
<key
|
||||
code="46"
|
||||
value="r"
|
||||
valueAlt="-" />
|
||||
<key
|
||||
code="47"
|
||||
value="s"
|
||||
valueAlt="'"
|
||||
valueSym="ś" />
|
||||
<key
|
||||
code="48"
|
||||
value="t"
|
||||
valueAlt="(" />
|
||||
<key
|
||||
code="49"
|
||||
value="u"
|
||||
valueAlt="1" />
|
||||
<key
|
||||
code="50"
|
||||
value="v"
|
||||
valueAlt="." />
|
||||
<key
|
||||
code="51"
|
||||
value="w"
|
||||
valueAlt="/" />
|
||||
<key
|
||||
code="52"
|
||||
value="x"
|
||||
valueAlt="?"
|
||||
valueSym="ź" />
|
||||
<key
|
||||
code="53"
|
||||
value="y"
|
||||
valueAlt=")" />
|
||||
<key
|
||||
code="54"
|
||||
value="z"
|
||||
valueAlt="!"
|
||||
valueSym="ż" />
|
||||
</keymap>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keymap>
|
||||
<key
|
||||
code="29"
|
||||
none="a"
|
||||
shift="A"
|
||||
alt="@" />
|
||||
<key
|
||||
code="30"
|
||||
none="b"
|
||||
shift="B"
|
||||
alt="7" />
|
||||
<key
|
||||
code="31"
|
||||
none="c"
|
||||
shift="C"
|
||||
alt="," />
|
||||
<key
|
||||
code="32"
|
||||
none="d"
|
||||
shift="D"
|
||||
alt=""" />
|
||||
<key
|
||||
code="33"
|
||||
none="e"
|
||||
shift="E"
|
||||
alt="_" />
|
||||
<key
|
||||
code="34"
|
||||
none="f"
|
||||
shift="F"
|
||||
alt="+" />
|
||||
<key
|
||||
code="35"
|
||||
none="g"
|
||||
shift="G"
|
||||
alt="*" />
|
||||
<key
|
||||
code="36"
|
||||
none="h"
|
||||
shift="H"
|
||||
alt="#" />
|
||||
<key
|
||||
code="37"
|
||||
none="i"
|
||||
shift="I"
|
||||
alt="2" />
|
||||
<key
|
||||
code="38"
|
||||
none="j"
|
||||
shift="J"
|
||||
alt="4" />
|
||||
<key
|
||||
code="39"
|
||||
none="k"
|
||||
shift="K"
|
||||
alt="5" />
|
||||
<key
|
||||
code="40"
|
||||
none="l"
|
||||
shift="L"
|
||||
alt="6" />
|
||||
<key
|
||||
code="41"
|
||||
none="m"
|
||||
shift="M"
|
||||
alt="9" />
|
||||
<key
|
||||
code="42"
|
||||
none="n"
|
||||
shift="N"
|
||||
alt="8" />
|
||||
<key
|
||||
code="43"
|
||||
none="o"
|
||||
shift="O"
|
||||
alt="3" />
|
||||
<key
|
||||
code="44"
|
||||
none="p"
|
||||
shift="P"
|
||||
alt="0" />
|
||||
<key
|
||||
code="45"
|
||||
none="q"
|
||||
shift="Q"
|
||||
alt=":" />
|
||||
<key
|
||||
code="46"
|
||||
none="r"
|
||||
shift="R"
|
||||
alt="-" />
|
||||
<key
|
||||
code="47"
|
||||
none="s"
|
||||
shift="S"
|
||||
alt="'" />
|
||||
<key
|
||||
code="48"
|
||||
none="t"
|
||||
shift="T"
|
||||
alt="(" />
|
||||
<key
|
||||
code="49"
|
||||
none="u"
|
||||
shift="U"
|
||||
alt="1" />
|
||||
<key
|
||||
code="50"
|
||||
none="v"
|
||||
shift="V"
|
||||
alt="." />
|
||||
<key
|
||||
code="51"
|
||||
none="w"
|
||||
shift="W"
|
||||
alt="/" />
|
||||
<key
|
||||
code="52"
|
||||
none="x"
|
||||
shift="X"
|
||||
alt="?" />
|
||||
<key
|
||||
code="53"
|
||||
none="y"
|
||||
shift="Y"
|
||||
alt=")" />
|
||||
<key
|
||||
code="54"
|
||||
none="z"
|
||||
shift="Z"
|
||||
alt="!" />
|
||||
</keymap>
|
||||
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keymap>
|
||||
<key
|
||||
code="29"
|
||||
none="a"
|
||||
shift="A"
|
||||
alt="@"
|
||||
sym="ą"
|
||||
shiftSym="Ą" />
|
||||
<key
|
||||
code="30"
|
||||
none="b"
|
||||
shift="B"
|
||||
alt="7" />
|
||||
<key
|
||||
code="31"
|
||||
none="c"
|
||||
shift="C"
|
||||
alt=","
|
||||
sym="ć"
|
||||
shiftSym="Ć" />
|
||||
<key
|
||||
code="32"
|
||||
none="d"
|
||||
shift="D"
|
||||
alt=""" />
|
||||
<key
|
||||
code="33"
|
||||
none="e"
|
||||
shift="E"
|
||||
alt="_"
|
||||
sym="ę"
|
||||
shiftSym="Ę" />
|
||||
<key
|
||||
code="34"
|
||||
none="f"
|
||||
shift="F"
|
||||
alt="+" />
|
||||
<key
|
||||
code="35"
|
||||
none="g"
|
||||
shift="G"
|
||||
alt="*" />
|
||||
<key
|
||||
code="36"
|
||||
none="h"
|
||||
shift="H"
|
||||
alt="#" />
|
||||
<key
|
||||
code="37"
|
||||
none="i"
|
||||
shift="I"
|
||||
alt="2" />
|
||||
<key
|
||||
code="38"
|
||||
none="j"
|
||||
shift="J"
|
||||
alt="4" />
|
||||
<key
|
||||
code="39"
|
||||
none="k"
|
||||
shift="K"
|
||||
alt="5" />
|
||||
<key
|
||||
code="40"
|
||||
none="l"
|
||||
shift="L"
|
||||
alt="6"
|
||||
sym="ł"
|
||||
shiftSym="Ł" />
|
||||
<key
|
||||
code="41"
|
||||
none="m"
|
||||
shift="M"
|
||||
alt="9" />
|
||||
<key
|
||||
code="42"
|
||||
none="n"
|
||||
shift="N"
|
||||
alt="8"
|
||||
sym="ń"
|
||||
shiftSym="Ń" />
|
||||
<key
|
||||
code="43"
|
||||
none="o"
|
||||
shift="O"
|
||||
alt="3"
|
||||
sym="ó"
|
||||
shiftSym="Ó" />
|
||||
<key
|
||||
code="44"
|
||||
none="p"
|
||||
shift="P"
|
||||
alt="0" />
|
||||
<key
|
||||
code="45"
|
||||
none="q"
|
||||
shift="Q"
|
||||
alt=":" />
|
||||
<key
|
||||
code="46"
|
||||
none="r"
|
||||
shift="R"
|
||||
alt="-" />
|
||||
<key
|
||||
code="47"
|
||||
none="s"
|
||||
shift="S"
|
||||
alt="'"
|
||||
sym="ś"
|
||||
shiftSym="Ś" />
|
||||
<key
|
||||
code="48"
|
||||
none="t"
|
||||
shift="T"
|
||||
alt="(" />
|
||||
<key
|
||||
code="49"
|
||||
none="u"
|
||||
shift="U"
|
||||
alt="1" />
|
||||
<key
|
||||
code="50"
|
||||
none="v"
|
||||
shift="V"
|
||||
alt="." />
|
||||
<key
|
||||
code="51"
|
||||
none="w"
|
||||
shift="W"
|
||||
alt="/" />
|
||||
<key
|
||||
code="52"
|
||||
none="x"
|
||||
shift="X"
|
||||
alt="?"
|
||||
sym="ź"
|
||||
shiftSym="Ź" />
|
||||
<key
|
||||
code="53"
|
||||
none="y"
|
||||
shift="Y"
|
||||
alt=")" />
|
||||
<key
|
||||
code="54"
|
||||
none="z"
|
||||
shift="Z"
|
||||
alt="!"
|
||||
sym="ż"
|
||||
shiftSym="Ż" />
|
||||
</keymap>
|
||||
@@ -1,8 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:supportsSwitchingToNextInputMethod="true">
|
||||
<subtype
|
||||
android:imeSubtypeMode="keyboard"
|
||||
android:isAsciiCapable="true"
|
||||
android:label="Default" />
|
||||
</input-method>
|
||||
android:settingsActivity="cfpi_fpsi.eu.titanboard.PreferencesActivity" />
|
||||
Reference in New Issue
Block a user