| 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 | { |