Merge pull request #198 from alvinhochun/3ds-patches

Some minor 3DS ImGui backend changes
This commit is contained in:
mtheall 2025-04-07 20:28:11 -05:00 committed by GitHub
commit f35a656a7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
@ -105,8 +105,8 @@ void updateGamepads (ImGuiIO &io_)
{
auto const buttonMapping = {
// clang-format off
std::make_pair (KEY_A, ImGuiKey_GamepadFaceDown), // A and B are swapped
std::make_pair (KEY_B, ImGuiKey_GamepadFaceRight), // this is more intuitive
std::make_pair (KEY_A, ImGuiKey_GamepadFaceRight),
std::make_pair (KEY_B, ImGuiKey_GamepadFaceDown),
std::make_pair (KEY_X, ImGuiKey_GamepadFaceUp),
std::make_pair (KEY_Y, ImGuiKey_GamepadFaceLeft),
std::make_pair (KEY_L, ImGuiKey_GamepadL1),
@ -225,9 +225,15 @@ bool imgui::ctru::init ()
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
io.BackendPlatformName = "3DS";
// enable Nintendo button layout
io.ConfigNavSwapGamepadButtons = true;
// disable mouse cursor
io.MouseDrawCursor = false;
// we only support touchscreen as mouse source
io.AddMouseSourceEvent (ImGuiMouseSource_TouchScreen);
auto &platformIO = ImGui::GetPlatformIO ();
// clipboard callbacks