File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 46
46
import android .view .SurfaceView ;
47
47
import android .view .View ;
48
48
import android .view .ViewGroup ;
49
+ import android .view .inputmethod .InputMethodManager ;
49
50
import processing .a2d .PGraphicsAndroid2D ;
50
51
import processing .android .AppComponent ;
51
52
import processing .data .*;
@@ -2391,6 +2392,22 @@ protected void nativeKeyEvent(android.view.KeyEvent event) {
2391
2392
}
2392
2393
2393
2394
2395
+ public void openKeyboard () {
2396
+ View view = surface .getRootView ();
2397
+ Context context = surface .getContext ();
2398
+ InputMethodManager imm = (InputMethodManager ) context .getSystemService (Context .INPUT_METHOD_SERVICE );
2399
+ imm .showSoftInput (view , InputMethodManager .SHOW_IMPLICIT );
2400
+ }
2401
+
2402
+
2403
+ public void closeKeyboard () {
2404
+ View view = surface .getRootView ();
2405
+ Context context = surface .getContext ();
2406
+ InputMethodManager imm =(InputMethodManager ) context .getSystemService (Context .INPUT_METHOD_SERVICE );
2407
+ imm .hideSoftInputFromWindow (view .getWindowToken (), 0 );
2408
+ }
2409
+
2410
+
2394
2411
public void keyPressed () { }
2395
2412
2396
2413
You can’t perform that action at this time.
0 commit comments