mirror of
https://github.com/Maschell/SDL2_Playground.git
synced 2024-11-27 15:14:17 +01:00
Add the mouse for non-win32 devices if they are not a wiiu
This commit is contained in:
parent
0dab74fd80
commit
7d38366aa0
@ -85,7 +85,7 @@ void ControllerManager::processEvent(SDL_JoystickID joystickId, int32_t channel,
|
|||||||
channel = joystickToChannel[joystickId];
|
channel = joystickToChannel[joystickId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (channel != -1 && controllerList.contains(static_cast<const GuiTrigger::eChannels>(channel))) {
|
if (channel != -1 && controllerList.count(static_cast<const GuiTrigger::eChannels>(channel)) > 0) {
|
||||||
controllerList[static_cast<GuiTrigger::eChannels>(channel)]->update(e, screenWidth, screenHeight);
|
controllerList[static_cast<GuiTrigger::eChannels>(channel)]->update(e, screenWidth, screenHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,8 @@ int main(int argc, char *args[]) {
|
|||||||
auto * controllerM = new ControllerManager(system->getWidth(), system->getHeight());
|
auto * controllerM = new ControllerManager(system->getWidth(), system->getHeight());
|
||||||
|
|
||||||
|
|
||||||
#if defined _WIN32
|
#ifndef __WIIU__
|
||||||
|
// On non-Wii-U devices we expect a mouse.
|
||||||
controllerM->attachController(GuiTrigger::CHANNEL_1, new SDLControllerMouse(GuiTrigger::CHANNEL_1));
|
controllerM->attachController(GuiTrigger::CHANNEL_1, new SDLControllerMouse(GuiTrigger::CHANNEL_1));
|
||||||
DEBUG_FUNCTION_LINE("Added mouse");
|
DEBUG_FUNCTION_LINE("Added mouse");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user