Merge pull request #857 from protocultor/gyro_bluetooth

Gyro aiming through Bluetooth for PS4 & PS5 controllers
This commit is contained in:
Yamagi 2022-07-22 09:53:00 +02:00 committed by GitHub
commit 2cb98b7a1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -1425,6 +1425,14 @@ IN_Controller_Init(qboolean notify_user)
if (!SDL_WasInit(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC))
{
#ifdef SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE // extended input reports on PS controllers (enables gyro thru bluetooth)
SDL_SetHint( SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1" );
#endif
#ifdef SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE
SDL_SetHint( SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1" );
#endif
if (SDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) == -1)
{
Com_Printf ("Couldn't init SDL joystick: %s.\n", SDL_GetError ());

View file

@ -1882,7 +1882,7 @@ Joy_MenuInit(void)
s_joy_yawsensitivity_slider.generic.name = "yaw sensitivity";
s_joy_yawsensitivity_slider.generic.callback = JoyYawSensitivityFunc;
s_joy_yawsensitivity_slider.minvalue = 0;
s_joy_yawsensitivity_slider.maxvalue = 20;
s_joy_yawsensitivity_slider.maxvalue = 70;
Menu_AddItem(&s_joy_menu, (void *)&s_joy_yawsensitivity_slider);
s_joy_pitchsensitivity_slider.curvalue = joy_pitchsensitivity->value * 10;
@ -1893,7 +1893,7 @@ Joy_MenuInit(void)
s_joy_pitchsensitivity_slider.generic.name = "pitch sensitivity";
s_joy_pitchsensitivity_slider.generic.callback = JoyPitchSensitivityFunc;
s_joy_pitchsensitivity_slider.minvalue = 0;
s_joy_pitchsensitivity_slider.maxvalue = 20;
s_joy_pitchsensitivity_slider.maxvalue = 70;
Menu_AddItem(&s_joy_menu, (void *)&s_joy_pitchsensitivity_slider);
y += 10;