diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java index cd154e10a..1a07c6b4f 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java @@ -381,6 +381,11 @@ public void updateFocusedView(View aFocusedView) { } public void dismiss() { + if (mPopupKeyboardLayer.getVisibility() == VISIBLE) { + hideOverlays(); + return; + } + exitVoiceInputMode(); if (mFocusedView != null && mFocusedView != mAttachedWindow) { mFocusedView.clearFocus(); @@ -393,7 +398,6 @@ public void dismiss() { mIsCapsLock = false; mIsLongPress = false; handleShift(false); - hideOverlays(); } public void proxifyLayerIfNeeded(ArrayList aWindows) { @@ -525,10 +529,6 @@ public void onKey(int primaryCode, int[] keyCodes, boolean hasPopup) { break; } - if (!mIsCapsLock && primaryCode != CustomKeyboard.KEYCODE_SHIFT && mPopupKeyboardView.getVisibility() != View.VISIBLE) { - handleShift(false); - } - mIsLongPress = false; mIsMultiTap = false; } @@ -543,6 +543,7 @@ public void onText(CharSequence text) { if (!mIsLongPress) { handleText(text.toString()); } + mIsLongPress = false; mIsMultiTap = false; } @@ -862,6 +863,11 @@ private void handleText(String aText) { final InputConnection connection = mInputConnection; postInputCommand(() -> connection.commitText(text, 1)); } + + if (!mIsCapsLock) { + handleShift(false); + } + updateCandidates(); }