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 3e6dc2c7f..5545b095e 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 @@ -578,10 +578,11 @@ public void onLongPress(Keyboard.Key popupKey) { mPopUpHoverDeviceId = -1; mIsLongPress = true; - } else if (popupKey.codes[0] == CustomKeyboard.KEYCODE_SHIFT) { mIsLongPress = !mIsCapsLock; - + } else if (popupKey.codes[0] == CustomKeyboard.KEYCODE_DOMAIN) { + handleDomainLongPress(); + mIsLongPress = true; } } @@ -824,6 +825,12 @@ private void handleEmojiInput() { } private void handleDomain() { + if (!mIsLongPress) { + handleText(mCurrentKeyboard.getDomains()[0]); + } + } + + private void handleDomainLongPress() { ArrayList items = new ArrayList<>(); for (String item: mCurrentKeyboard.getDomains()) { items.add(new KeyboardSelectorView.Item(item, item)); @@ -837,6 +844,15 @@ private void handleDomain() { mDomainHoverDeviceId = -1; } + private void handleDomainChange(KeyboardSelectorView.Item aItem) { + handleText(aItem.title, true); + + disableShift(getSymbolsKeyboard()); + handleShift(false); + hideOverlays(); + updateCandidates(); + } + private void handleLanguageChange(KeyboardInterface aKeyboard) { cleanComposingText(); @@ -869,15 +885,6 @@ private void handleLanguageChange(KeyboardInterface aKeyboard) { mCurrentKeyboard.getAlphabeticKeyboard().setSpaceKeyLabel(spaceText); } - private void handleDomainChange(KeyboardSelectorView.Item aItem) { - handleText(aItem.title, true); - - disableShift(getSymbolsKeyboard()); - handleShift(false); - hideOverlays(); - updateCandidates(); - } - private void disableShift(@NonNull CustomKeyboard keyboard) { int[] shiftIndices = keyboard.getShiftKeyIndices(); for (int shiftIndex: shiftIndices) {