mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-23 06:21:57 +00:00
Fixed bug #4843 - Can not get the ime candidatelist like chinese/japaness input method
This commit is contained in:
parent
7fb4364391
commit
ccb12457f9
3 changed files with 40 additions and 1 deletions
|
|
@ -102,6 +102,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
/** If shared libraries (e.g. SDL or the native application) could not be loaded. */
|
||||
public static boolean mBrokenLibraries = true;
|
||||
|
||||
public static int mInputType = 1;
|
||||
|
||||
// Main components
|
||||
protected static SDLActivity mSingleton;
|
||||
protected static SDLSurface mSurface;
|
||||
|
|
@ -1184,6 +1186,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
return event.isPrintingKey() || event.getKeyCode() == KeyEvent.KEYCODE_SPACE;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int setInputType(int type) {
|
||||
mInputType = type;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
|
|
@ -2182,7 +2192,14 @@ class DummyEdit extends View implements View.OnKeyListener {
|
|||
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||
ic = new SDLInputConnection(this, true);
|
||||
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
|
||||
if (SDLActivity.mInputType == 0) {
|
||||
/* 0 normal: use input method */
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
|
||||
} else {
|
||||
/* 1 password (default): can not use input method,just use english */
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
|
||||
}
|
||||
|
||||
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
|
||||
| EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue