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
public void showKeyboard() {
LimeLog.info("Showing keyboard overlay");
public void toggleKeyboard() {
LimeLog.info("Toggling keyboard overlay");
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
@@ -1471,7 +1471,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
// All fingers up
if (SystemClock.uptimeMillis() - threeFingerDownTime < THREE_FINGER_TAP_THRESHOLD) {
// This is a 3 finger tap to bring up the keyboard
showKeyboard();
toggleKeyboard();
return true;
}
}

View File

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