mirror of
https://github.com/mtheall/ftpd.git
synced 2025-06-18 19:15:33 -04:00
imgui_ctru: Send proper mouse events for touchscreen
This is the canonical way of handling touch events. Some controls (e.g. TabBar) depends on knowing the input is a touchscreen to work properly.
This commit is contained in:
parent
e0f2ed69c4
commit
5037297b7b
@ -85,7 +85,7 @@ void updateTouch (ImGuiIO &io_)
|
||||
if (!(hidKeysHeld () & KEY_TOUCH))
|
||||
{
|
||||
// set mouse cursor off-screen
|
||||
io_.AddMousePosEvent (-10.0f, -10.0f);
|
||||
io_.AddMousePosEvent (-FLT_MAX, -FLT_MAX);
|
||||
io_.AddMouseButtonEvent (0, false);
|
||||
return;
|
||||
}
|
||||
@ -228,6 +228,9 @@ bool imgui::ctru::init ()
|
||||
// disable mouse cursor
|
||||
io.MouseDrawCursor = false;
|
||||
|
||||
// we only support touchscreen as mouse source
|
||||
io.AddMouseSourceEvent (ImGuiMouseSource_TouchScreen);
|
||||
|
||||
auto &platformIO = ImGui::GetPlatformIO ();
|
||||
|
||||
// clipboard callbacks
|
||||
|
Loading…
Reference in New Issue
Block a user