| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | return (SDL_SYS_numjoysticks); |
| | | } |
| | | |
| | | int SDL_SYS_NumJoysticks() |
| | | int |
| | | SDL_SYS_NumJoysticks(void) |
| | | { |
| | | return SDL_SYS_numjoysticks; |
| | | } |
| | | |
| | | void SDL_SYS_JoystickDetect() |
| | | void |
| | | SDL_SYS_JoystickDetect(void) |
| | | { |
| | | } |
| | | |
| | |
| | | v *= 32768 / ((ymax - ymin + 1) / 2); |
| | | SDL_PrivateJoystickAxis(joy, 1, v); |
| | | } |
| | | if (gameport.b1 != joy->buttons[0]) { |
| | | SDL_PrivateJoystickButton(joy, 0, gameport.b1); |
| | | } |
| | | if (gameport.b2 != joy->buttons[1]) { |
| | | SDL_PrivateJoystickButton(joy, 1, gameport.b2); |
| | | } |
| | | SDL_PrivateJoystickButton(joy, 0, gameport.b1); |
| | | SDL_PrivateJoystickButton(joy, 1, gameport.b2); |
| | | } |
| | | return; |
| | | } |
| | |
| | | v *= 32768 / |
| | | ((hitem.logical_maximum - |
| | | hitem.logical_minimum + 1) / 2); |
| | | if (v != joy->axes[naxe]) { |
| | | SDL_PrivateJoystickAxis(joy, naxe, v); |
| | | } |
| | | SDL_PrivateJoystickAxis(joy, naxe, v); |
| | | } else if (usage == HUG_HAT_SWITCH) { |
| | | v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); |
| | | SDL_PrivateJoystickHat(joy, 0, |
| | |
| | | } |
| | | case HUP_BUTTON: |
| | | v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); |
| | | if (joy->buttons[nbutton] != v) { |
| | | SDL_PrivateJoystickButton(joy, nbutton, v); |
| | | } |
| | | SDL_PrivateJoystickButton(joy, nbutton, v); |
| | | nbutton++; |
| | | break; |
| | | default: |