src/joystick/bsd/SDL_sysjoystick.c
changeset 12911 0c19a7239a95
parent 12738 64dabb27041d
equal deleted inserted replaced
12910:dd9169424181 12911:0c19a7239a95
   621                             SDL_PrivateJoystickHat(joy, 0,
   621                             SDL_PrivateJoystickHat(joy, 0,
   622                                                    hatval_to_sdl(v) -
   622                                                    hatval_to_sdl(v) -
   623                                                    hitem.logical_minimum);
   623                                                    hitem.logical_minimum);
   624                         }
   624                         }
   625 #ifdef __OpenBSD__
   625 #ifdef __OpenBSD__
   626                         else if (usage == HUG_DPAD_UP)
   626                         else if (usage == HUG_DPAD_UP) {
   627                             dpad[0] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   627                             dpad[0] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   628                         else if (usage == HUG_DPAD_DOWN)
   628                             SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
       
   629                         }
       
   630                         else if (usage == HUG_DPAD_DOWN) {
   629                             dpad[1] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   631                             dpad[1] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   630                         else if (usage == HUG_DPAD_RIGHT)
   632                             SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
       
   633                         }
       
   634                         else if (usage == HUG_DPAD_RIGHT) {
   631                             dpad[2] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   635                             dpad[2] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   632                         else if (usage == HUG_DPAD_LEFT)
   636                             SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
       
   637                         }
       
   638                         else if (usage == HUG_DPAD_LEFT) {
   633                             dpad[3] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   639                             dpad[3] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
       
   640                             SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
       
   641                         }
   634 #endif
   642 #endif
   635                         break;
   643                         break;
   636                     }
   644                     }
   637                 case HUP_BUTTON:
   645                 case HUP_BUTTON:
   638                     v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   646                     v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
   645                 break;
   653                 break;
   646             default:
   654             default:
   647                 break;
   655                 break;
   648             }
   656             }
   649         }
   657         }
   650 #ifdef __OpenBSD__
       
   651         SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad));
       
   652 #endif
       
   653         hid_end_parse(hdata);
   658         hid_end_parse(hdata);
   654     }
   659     }
   655 }
   660 }
   656 
   661 
   657 /* Function to close a joystick after use */
   662 /* Function to close a joystick after use */