Toggle the IME with a 3 finger tap rather than only showing it

This commit is contained in:
Cameron Gutman
2022-06-28 21:40:59 -05:00
parent 9c76defad0
commit 84296c6e1c
2 changed files with 5 additions and 5 deletions

View File

@@ -1231,10 +1231,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
} }
@Override @Override
public void showKeyboard() { public void toggleKeyboard() {
LimeLog.info("Showing keyboard overlay"); LimeLog.info("Toggling keyboard overlay");
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); inputManager.toggleSoftInput(0, 0);
} }
// Returns true if the event was consumed // Returns true if the event was consumed
@@ -1471,7 +1471,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
// All fingers up // All fingers up
if (SystemClock.uptimeMillis() - threeFingerDownTime < THREE_FINGER_TAP_THRESHOLD) { if (SystemClock.uptimeMillis() - threeFingerDownTime < THREE_FINGER_TAP_THRESHOLD) {
// This is a 3 finger tap to bring up the keyboard // This is a 3 finger tap to bring up the keyboard
showKeyboard(); toggleKeyboard();
return true; return true;
} }
} }

View File

@@ -1,5 +1,5 @@
package com.limelight.ui; package com.limelight.ui;
public interface GameGestures { public interface GameGestures {
void showKeyboard(); void toggleKeyboard();
} }