1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Allow toggling touchscreen mode at runtime (#14075)

Signed-off-by: David Heidelberg <david@ixit.cz>
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
This commit is contained in:
David Heidelberg 2024-02-22 16:44:49 +01:00 committed by GitHub
parent e3cc26cb7c
commit 34286d77c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 175 additions and 220 deletions

View file

@ -102,11 +102,9 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
React to nothing here if a menu is active
*/
if (isMenuActive()) {
#ifdef HAVE_TOUCHSCREENGUI
if (m_touchscreengui) {
m_touchscreengui->setVisible(false);
}
#endif
return g_menumgr.preprocessEvent(event);
}
@ -130,12 +128,10 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
return true;
}
#ifdef HAVE_TOUCHSCREENGUI
} else if (m_touchscreengui && event.EventType == irr::EET_TOUCH_INPUT_EVENT) {
// In case of touchscreengui, we have to handle different events
m_touchscreengui->translateEvent(event);
return true;
#endif
} else if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT) {
// joystick may be nullptr if game is launched with '--random-input' parameter