mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-06 04:00:08 +00:00
Extended TextInputTarget to include a preference for the type of virtual keyboard (implemented on iOS + android)
This commit is contained in:
parent
fd5df871ed
commit
f96ee7c860
10 changed files with 81 additions and 21 deletions
|
|
@ -399,16 +399,21 @@ public final class JuceAppActivity extends Activity
|
|||
private native void handleKeyDown (long host, int keycode, int textchar);
|
||||
private native void handleKeyUp (long host, int keycode, int textchar);
|
||||
|
||||
public void showKeyboard (boolean shouldShow)
|
||||
public void showKeyboard (String type)
|
||||
{
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService (Context.INPUT_METHOD_SERVICE);
|
||||
|
||||
if (imm != null)
|
||||
{
|
||||
if (shouldShow)
|
||||
imm.showSoftInput (this, InputMethodManager.SHOW_FORCED);
|
||||
if (! type.isEmpty())
|
||||
{
|
||||
imm.showSoftInput (this, android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT);
|
||||
imm.setInputMethod (getWindowToken(), type);
|
||||
}
|
||||
else
|
||||
{
|
||||
imm.hideSoftInputFromWindow (getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue