MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / ProcessTouchpadClick

Function ProcessTouchpadClick

include/Controller.hpp:1004–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002 }
1003
1004 static void ProcessTouchpadClick()
1005 {
1006 if (!s_pGamepad || !s_capabilities.hasTouchpad || !s_touchpadConfig.isEnabled)
1007 return;
1008
1009 bool isPressed = SDL_GetGamepadButton(s_pGamepad, SDL_GAMEPAD_BUTTON_TOUCHPAD);
1010
1011 if (isPressed && !s_wasTouchpadPressed[0])
1012 {
1013 INPUT input = {};
1014 input.type = INPUT_MOUSE;
1015 input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
1016 SendInput(1, &input, sizeof(INPUT));
1017 }
1018 else if (!isPressed && s_wasTouchpadPressed[0])
1019 {
1020 INPUT input = {};
1021 input.type = INPUT_MOUSE;
1022 input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
1023 SendInput(1, &input, sizeof(INPUT));
1024 }
1025
1026 s_wasTouchpadPressed[0] = isPressed;
1027 }
1028
1029 inline void ReleaseTouchpadClick()
1030 {

Callers 1

PollControllerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected