mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 10:35:03 +00:00
Move sd;_gamepad_added event from remap object to GUI object to avoid conflicts with sdl window
This commit is contained in:
parent
db65bf48c4
commit
cd4931b16f
@ -779,11 +779,6 @@ bool ControlSettings::eventFilter(QObject* obj, QEvent* event) {
|
||||
}
|
||||
|
||||
void ControlSettings::processSDLEvents(int Type, int Input, int Value) {
|
||||
if (Type == SDL_EVENT_GAMEPAD_ADDED) {
|
||||
if (!GameRunning)
|
||||
CheckGamePad();
|
||||
}
|
||||
|
||||
if (EnableButtonMapping) {
|
||||
if (Type == SDL_EVENT_GAMEPAD_BUTTON_DOWN) {
|
||||
switch (Input) {
|
||||
@ -891,10 +886,19 @@ void ControlSettings::processSDLEvents(int Type, int Input, int Value) {
|
||||
void ControlSettings::pollSDLEvents() {
|
||||
SDL_Event event;
|
||||
while (SdlEventWrapper::Wrapper::wrapperActive) {
|
||||
|
||||
if (!SDL_WaitEvent(&event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.type == SDL_EVENT_QUIT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.type == SDL_EVENT_GAMEPAD_ADDED) {
|
||||
CheckGamePad();
|
||||
}
|
||||
|
||||
SdlEventWrapper::Wrapper::GetInstance()->Wrapper::ProcessEvent(&event);
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,6 @@ bool Wrapper::ProcessEvent(SDL_Event* event) {
|
||||
case SDL_EVENT_QUIT:
|
||||
emit SDLEvent(SDL_EVENT_QUIT, 0, 0);
|
||||
return true;
|
||||
case SDL_EVENT_GAMEPAD_ADDED:
|
||||
emit SDLEvent(SDL_EVENT_GAMEPAD_ADDED, 0, 0);
|
||||
return true;
|
||||
case SDL_EVENT_GAMEPAD_BUTTON_DOWN:
|
||||
emit SDLEvent(SDL_EVENT_GAMEPAD_BUTTON_DOWN, event->gbutton.button, 0);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user