mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
Auto-toggle TouchControls in-game when receiving touch/mouse input
This commit is contained in:
@@ -418,6 +418,11 @@ TouchControls::TouchControls(IrrlichtDevice *device, ISimpleTextureSource *tsrc)
|
||||
m_status_text->setVisible(false);
|
||||
}
|
||||
|
||||
TouchControls::~TouchControls()
|
||||
{
|
||||
releaseAll();
|
||||
}
|
||||
|
||||
void TouchControls::addButton(std::vector<button_info> &buttons, touch_gui_button_id id,
|
||||
const std::string &image, const recti &rect, bool visible)
|
||||
{
|
||||
@@ -843,6 +848,7 @@ void TouchControls::emitMouseEvent(EMOUSE_INPUT_EVENT type)
|
||||
event.MouseInput.Control = false;
|
||||
event.MouseInput.ButtonStates = 0;
|
||||
event.MouseInput.Event = type;
|
||||
event.MouseInput.Simulated = true;
|
||||
m_receiver->OnEvent(event);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user