mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Added touchpad button handling
This commit is contained in:
parent
1d8347e1dd
commit
8328148f1d
@ -215,11 +215,17 @@ void WindowSDL::OnKeyboardMouseInput(const SDL_Event* event) {
|
|||||||
void WindowSDL::OnGamepadEvent(const SDL_Event* event) {
|
void WindowSDL::OnGamepadEvent(const SDL_Event* event) {
|
||||||
|
|
||||||
bool input_down = event->type == SDL_EVENT_GAMEPAD_AXIS_MOTION ||
|
bool input_down = event->type == SDL_EVENT_GAMEPAD_AXIS_MOTION ||
|
||||||
event->type == SDL_EVENT_GAMEPAD_BUTTON_DOWN ||
|
event->type == SDL_EVENT_GAMEPAD_BUTTON_DOWN;
|
||||||
event->type == SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN ||
|
|
||||||
event->type == SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION;
|
|
||||||
u32 input_id = Input::InputBinding::GetInputIDFromEvent(*event);
|
u32 input_id = Input::InputBinding::GetInputIDFromEvent(*event);
|
||||||
|
|
||||||
|
// the touchpad button shouldn't be rebound to anything else,
|
||||||
|
// as it would break the entire touchpad handling
|
||||||
|
// You can still bind other things to it though
|
||||||
|
if (event->gbutton.button == SDL_GAMEPAD_BUTTON_TOUCHPAD) {
|
||||||
|
controller->CheckButton(0, OrbisPadButtonDataOffset::TouchPad, input_down);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool inputs_changed = Input::UpdatePressedKeys(input_id, input_down);
|
bool inputs_changed = Input::UpdatePressedKeys(input_id, input_down);
|
||||||
|
|
||||||
if (inputs_changed) {
|
if (inputs_changed) {
|
||||||
|
Loading…
Reference in New Issue
Block a user