Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.89 KB | None | 0 0
  1. diff --git a/imgui_impl_vitagl.cpp b/imgui_impl_vitagl.cpp
  2. index 121d627..80dca6e 100644
  3. --- a/imgui_impl_vitagl.cpp
  4. +++ b/imgui_impl_vitagl.cpp
  5. @@ -392,8 +392,22 @@ void ImGui_ImplVitaGL_NewFrame()
  6.                 IN_RescaleAnalog(&lx, &ly, 30);
  7.                 mx += lx >> 2;
  8.                 my += ly >> 2;
  9. -               g_MousePressed[0] = pad.buttons & SCE_CTRL_LTRIGGER;
  10. -               g_MousePressed[1] = pad.buttons & SCE_CTRL_RTRIGGER;
  11. +               if (!(pad.buttons & SCE_CTRL_SQUARE)) {
  12. +                       g_MousePressed[0] = pad.buttons & SCE_CTRL_LTRIGGER;
  13. +                       g_MousePressed[1] = pad.buttons & SCE_CTRL_RTRIGGER;
  14. +               }
  15. +
  16. +               if (pad.buttons & SCE_CTRL_CROSS)    io.NavInputs[ImGuiNavInput_Activate] = 1.0f;
  17. +               if (pad.buttons & SCE_CTRL_CIRCLE)   io.NavInputs[ImGuiNavInput_Cancel] = 1.0f;
  18. +               if (pad.buttons & SCE_CTRL_TRIANGLE) io.NavInputs[ImGuiNavInput_Input] = 1.0f;
  19. +               if (pad.buttons & SCE_CTRL_SQUARE)   io.NavInputs[ImGuiNavInput_Menu] = 1.0f;
  20. +               if (pad.buttons & SCE_CTRL_LEFT)     io.NavInputs[ImGuiNavInput_DpadLeft] = 1.0f;
  21. +               if (pad.buttons & SCE_CTRL_RIGHT)    io.NavInputs[ImGuiNavInput_DpadRight] = 1.0f;
  22. +               if (pad.buttons & SCE_CTRL_UP)       io.NavInputs[ImGuiNavInput_DpadUp] = 1.0f;
  23. +               if (pad.buttons & SCE_CTRL_DOWN)     io.NavInputs[ImGuiNavInput_DpadDown] = 1.0f;
  24. +               // FIXME: LStick{Left,Right,Up,Down} should be defined here if Menu button is held, rather than setting mouse movements
  25. +               if (pad.buttons & SCE_CTRL_LTRIGGER) io.NavInputs[ImGuiNavInput_FocusPrev] = 1.0f;
  26. +               if (pad.buttons & SCE_CTRL_RTRIGGER) io.NavInputs[ImGuiNavInput_FocusNext] = 1.0f;
  27.         }
  28.  
  29.         // Setup mouse inputs (we already got mouse wheel, keyboard keys & characters from our event handler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement