Mercurial > repos > blastem
comparison render_sdl.c @ 1194:1ad0ec7e3939
Make gamepad "semantic" mapping play nice with hotplug support
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 24 Jan 2017 20:53:10 -0800 |
parents | 6a4503fad67e |
children | 8715174e9366 |
comparison
equal
deleted
inserted
replaced
1193:0e69409634f3 | 1194:1ad0ec7e3939 |
---|---|
816 SDL_Joystick * joy = joysticks[index] = SDL_JoystickOpen(event->jdevice.which); | 816 SDL_Joystick * joy = joysticks[index] = SDL_JoystickOpen(event->jdevice.which); |
817 joystick_sdl_index[index] = event->jdevice.which; | 817 joystick_sdl_index[index] = event->jdevice.which; |
818 if (joy) { | 818 if (joy) { |
819 printf("Joystick %d added: %s\n", index, SDL_JoystickName(joy)); | 819 printf("Joystick %d added: %s\n", index, SDL_JoystickName(joy)); |
820 printf("\tNum Axes: %d\n\tNum Buttons: %d\n\tNum Hats: %d\n", SDL_JoystickNumAxes(joy), SDL_JoystickNumButtons(joy), SDL_JoystickNumHats(joy)); | 820 printf("\tNum Axes: %d\n\tNum Buttons: %d\n\tNum Hats: %d\n", SDL_JoystickNumAxes(joy), SDL_JoystickNumButtons(joy), SDL_JoystickNumHats(joy)); |
821 handle_joy_added(index); | |
821 } | 822 } |
822 } | 823 } |
823 } | 824 } |
824 break; | 825 break; |
825 case SDL_JOYDEVICEREMOVED: { | 826 case SDL_JOYDEVICEREMOVED: { |