sdl: osx polishing

This commit is contained in:
Flyinghead 2019-08-14 22:48:34 +02:00
parent ed858c029a
commit eaedf7d017
1 changed files with 4 additions and 3 deletions

View File

@ -71,9 +71,9 @@ void input_sdl_init()
if (SDL_WasInit(SDL_INIT_HAPTIC) == 0) if (SDL_WasInit(SDL_INIT_HAPTIC) == 0)
SDL_InitSubSystem(SDL_INIT_HAPTIC); SDL_InitSubSystem(SDL_INIT_HAPTIC);
#if HOST_OS != OS_DARWIN
SDL_SetRelativeMouseMode(SDL_FALSE); SDL_SetRelativeMouseMode(SDL_FALSE);
#if HOST_OS != OS_DARWIN
sdl_keyboard = new SDLKeyboardDevice(0); sdl_keyboard = new SDLKeyboardDevice(0);
sdl_kb_gamepad = std::make_shared<SDLKbGamepadDevice>(0); sdl_kb_gamepad = std::make_shared<SDLKbGamepadDevice>(0);
GamepadDevice::Register(sdl_kb_gamepad); GamepadDevice::Register(sdl_kb_gamepad);
@ -116,10 +116,11 @@ void input_sdl_handle(u32 port)
{ {
switch (event.type) switch (event.type)
{ {
case SDL_QUIT: #if HOST_OS != OS_DARWIN
case SDL_QUIT:
dc_exit(); dc_exit();
break; break;
#if HOST_OS != OS_DARWIN
case SDL_KEYDOWN: case SDL_KEYDOWN:
case SDL_KEYUP: case SDL_KEYUP:
sdl_kb_gamepad->gamepad_btn_input(event.key.keysym.sym, event.type == SDL_KEYDOWN); sdl_kb_gamepad->gamepad_btn_input(event.key.keysym.sym, event.type == SDL_KEYDOWN);