aboutsummaryrefslogtreecommitdiff
path: root/ime/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'ime/app/src/main/java')
-rw-r--r--ime/app/src/main/java/com/anysoftkeyboard/keyboards/Keyboard.java5
-rw-r--r--ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/AnyKeyboardViewBase.java2
-rw-r--r--ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/PointerTracker.java7
3 files changed, 13 insertions, 1 deletions
diff --git a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/Keyboard.java b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/Keyboard.java
index 6c14ef955..bf4f2694e 100644
--- a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/Keyboard.java
+++ b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/Keyboard.java
@@ -334,6 +334,8 @@ public abstract class Keyboard {
public boolean pressed;
/** Text to output when pressed. This can be multiple characters, like ".com" */
public CharSequence text;
+ /** Text to output when pressed and shifted. This can be multiple characters, like ".com" */
+ public CharSequence shiftedText;
/** Popup characters */
public CharSequence popupCharacters;
@@ -535,6 +537,9 @@ public abstract class Keyboard {
case android.R.attr.keyOutputText:
text = a.getText(remoteIndex);
break;
+ case R.attr.shiftedKeyOutputText:
+ shiftedText = a.getText(remoteIndex);
+ break;
}
// CHECKSTYLE:ON: missingswitchdefault
}
diff --git a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/AnyKeyboardViewBase.java b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/AnyKeyboardViewBase.java
index 3b155dd46..f6480555a 100644
--- a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/AnyKeyboardViewBase.java
+++ b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/AnyKeyboardViewBase.java
@@ -1151,6 +1151,8 @@ public class AnyKeyboardViewBase extends View implements InputViewBinder, Pointe
if (isShiftedAccordingToCaseType(mKeyboard.isShifted())) {
if (!TextUtils.isEmpty(key.shiftedKeyLabel)) {
return key.shiftedKeyLabel;
+ } else if (key.shiftedText != null) {
+ label = key.shiftedText;
} else if (label != null && label.length() == 1) {
label =
Character.toString(
diff --git a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/PointerTracker.java b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/PointerTracker.java
index 2ad966ddd..b8adabb8d 100644
--- a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/PointerTracker.java
+++ b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/views/PointerTracker.java
@@ -466,11 +466,16 @@ class PointerTracker {
listener.onCancel();
}
} else {
- if (key.text != null) {
+ if (key.text != null && !mKeyDetector.isKeyShifted(key)) {
if (listener != null) {
listener.onText(key, key.text);
listener.onRelease(0); // dummy key code
}
+ } else if (key.shiftedText != null && mKeyDetector.isKeyShifted(key)) {
+ if (listener != null) {
+ listener.onText(key, key.shiftedText);
+ listener.onRelease(0); // dummy key code
+ }
} else {
int code = key.getCodeAtIndex(0, mKeyDetector.isKeyShifted(key));
int[] nearByKeyCodes = mKeyDetector.newCodeArray();