mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 859452 - Send characters as keys when using HTC Touch Input. r=cpeterson
This commit is contained in:
parent
25926ae20a
commit
f3ea57250b
@ -199,7 +199,7 @@ class GeckoInputConnection
|
||||
private boolean mBatchSelectionChanged;
|
||||
private boolean mBatchTextChanged;
|
||||
private long mLastRestartInputTime;
|
||||
private final InputConnection mPluginInputConnection;
|
||||
private final InputConnection mKeyInputConnection;
|
||||
|
||||
public static GeckoEditableListener create(View targetView,
|
||||
GeckoEditableClient editable) {
|
||||
@ -214,8 +214,8 @@ class GeckoInputConnection
|
||||
super(targetView, true);
|
||||
mEditableClient = editable;
|
||||
mIMEState = IME_STATE_DISABLED;
|
||||
// InputConnection for plugins, which don't have full editors
|
||||
mPluginInputConnection = new BaseInputConnection(targetView, false);
|
||||
// InputConnection that sends keys for plugins, which don't have full editors
|
||||
mKeyInputConnection = new BaseInputConnection(targetView, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -641,7 +641,7 @@ class GeckoInputConnection
|
||||
// Since we are using a temporary string as the editable, the selection is at 0
|
||||
outAttrs.initialSelStart = 0;
|
||||
outAttrs.initialSelEnd = 0;
|
||||
return mPluginInputConnection;
|
||||
return mKeyInputConnection;
|
||||
}
|
||||
Editable editable = getEditable();
|
||||
outAttrs.initialSelStart = Selection.getSelectionStart(editable);
|
||||
@ -649,6 +649,16 @@ class GeckoInputConnection
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||
if (InputMethods.shouldCommitCharAsKey(mCurrentInputMethod) &&
|
||||
text.length() == 1 && newCursorPosition > 0) {
|
||||
// mKeyInputConnection is a BaseInputConnection that commits text as keys;
|
||||
return mKeyInputConnection.commitText(text, newCursorPosition);
|
||||
}
|
||||
return super.commitText(text, newCursorPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendKeyEvent(KeyEvent event) {
|
||||
// BaseInputConnection.sendKeyEvent() dispatches the key event to the main thread.
|
||||
|
@ -19,6 +19,7 @@ final class InputMethods {
|
||||
public static final String METHOD_ATOK = "com.justsystems.atokmobile.service/.AtokInputMethodService";
|
||||
public static final String METHOD_GOOGLE_JAPANESE_INPUT = "com.google.android.inputmethod.japanese/.MozcService";
|
||||
public static final String METHOD_GOOGLE_LATINIME = "com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME";
|
||||
public static final String METHOD_HTC_TOUCH_INPUT = "com.htc.android.htcime/.HTCIMEService";
|
||||
public static final String METHOD_IWNN = "jp.co.omronsoft.iwnnime.ml/.standardcommon.IWnnLanguageSwitcher";
|
||||
public static final String METHOD_OPENWNN_PLUS = "com.owplus.ime.openwnnplus/.OpenWnnJAJP";
|
||||
public static final String METHOD_SAMSUNG = "com.sec.android.inputmethod/.SamsungKeypad";
|
||||
@ -56,6 +57,10 @@ final class InputMethods {
|
||||
METHOD_GOOGLE_LATINIME.equals(inputMethod));
|
||||
}
|
||||
|
||||
public static boolean shouldCommitCharAsKey(String inputMethod) {
|
||||
return METHOD_HTC_TOUCH_INPUT.equals(inputMethod);
|
||||
}
|
||||
|
||||
public static boolean shouldDelayAwesomebarUpdate(Context context) {
|
||||
String inputMethod = getCurrentInputMethod(context);
|
||||
return METHOD_SAMSUNG.equals(inputMethod) ||
|
||||
|
Loading…
Reference in New Issue
Block a user