mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Android: open input dialog on double tap with physical keyboard (#16269)
This commit is contained in:
		@@ -246,8 +246,9 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
 | 
			
		||||
#ifdef __ANDROID__
 | 
			
		||||
	// display software keyboard when clicking edit boxes
 | 
			
		||||
	if (event.EventType == EET_MOUSE_INPUT_EVENT &&
 | 
			
		||||
			event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN &&
 | 
			
		||||
			!porting::hasPhysicalKeyboardAndroid()) {
 | 
			
		||||
			((event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN &&
 | 
			
		||||
			!porting::hasPhysicalKeyboardAndroid()) ||
 | 
			
		||||
			event.MouseInput.Event == EMIE_LMOUSE_DOUBLE_CLICK)) {
 | 
			
		||||
		gui::IGUIElement *hovered =
 | 
			
		||||
			Environment->getRootGUIElement()->getElementFromPoint(
 | 
			
		||||
				core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y));
 | 
			
		||||
@@ -276,7 +277,9 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
 | 
			
		||||
 | 
			
		||||
			porting::showTextInputDialog("",
 | 
			
		||||
					wide_to_utf8(((gui::IGUIEditBox *) hovered)->getText()), type);
 | 
			
		||||
			return retval;
 | 
			
		||||
			// Since we have opened the dialog, we have to return true to mark
 | 
			
		||||
			// the event as handled (avoids double-opening).
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user