Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 2933730

Browse files
authored
Fixes #2562 Handle shift switching also for text keys (#2685)
* Handle shift switching also for text keys * Cancel shift after adding a character from the popup menu * Close overlays if opened when clicking the back button
1 parent 3949e4c commit 2933730

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ public void updateFocusedView(View aFocusedView) {
381381
}
382382

383383
public void dismiss() {
384+
if (mPopupKeyboardLayer.getVisibility() == VISIBLE) {
385+
hideOverlays();
386+
return;
387+
}
388+
384389
exitVoiceInputMode();
385390
if (mFocusedView != null && mFocusedView != mAttachedWindow) {
386391
mFocusedView.clearFocus();
@@ -393,7 +398,6 @@ public void dismiss() {
393398
mIsCapsLock = false;
394399
mIsLongPress = false;
395400
handleShift(false);
396-
hideOverlays();
397401
}
398402

399403
public void proxifyLayerIfNeeded(ArrayList<WindowWidget> aWindows) {
@@ -525,10 +529,6 @@ public void onKey(int primaryCode, int[] keyCodes, boolean hasPopup) {
525529
break;
526530
}
527531

528-
if (!mIsCapsLock && primaryCode != CustomKeyboard.KEYCODE_SHIFT && mPopupKeyboardView.getVisibility() != View.VISIBLE) {
529-
handleShift(false);
530-
}
531-
532532
mIsLongPress = false;
533533
mIsMultiTap = false;
534534
}
@@ -543,6 +543,7 @@ public void onText(CharSequence text) {
543543
if (!mIsLongPress) {
544544
handleText(text.toString());
545545
}
546+
546547
mIsLongPress = false;
547548
mIsMultiTap = false;
548549
}
@@ -862,6 +863,11 @@ private void handleText(String aText) {
862863
final InputConnection connection = mInputConnection;
863864
postInputCommand(() -> connection.commitText(text, 1));
864865
}
866+
867+
if (!mIsCapsLock) {
868+
handleShift(false);
869+
}
870+
865871
updateCandidates();
866872
}
867873

0 commit comments

Comments
 (0)