Closed selimrecep closed 11 months ago
I hope you can solve your problem mate
Interesting. I'm running Windows 11, and when I press that button on my controller, Windows takes a screenshot of my game.
It is probably because it is included in Windows 11 as a feature but they didn't include it in Windows 10 unfortunately... https://www.neowin.net/news/you-can-now-use-the-xbox-share-button-feature-on-windows-11-pcs-too/
Feel free to use controllermap to map all the buttons on the controller and post the config here, and I'll include it in the next SDL release.
And I just realised it is just not about share button... Since the library somehow accepts my controller as RAWInput, it doesnt allow me to haptic, I thought maybe HIDPInput wasnt available on Windows, but I cant even use it through XInput interface, I got a bit in deep and realised 14th character of GUID is actually 'r' which means it is a raw input, but still couldn't find out how is GUID being generated... Some screenshots from device manager. I believe bluetooth one refers to wireless connection where as others relate to USB connection to the connector... Or one of them could be a common interface.
Thank you, I think I can do that(mapping) but I think I still have a rawinput issue(which is the main issue, I believe), I am on it so I can find out if it is really seens as raw input instead of xinput by the library. Or maybe I should create another issue for that
SDL uses a hybrid solution to allow more than 4 Xbox controllers, and it looks at raw input, XInput, and WGI to achieve this.
I see, but is there a way to at least vibrate(via HapticEffect(s)) the controller over a RawInput device? Because I couldnt achieve it with the minimal code I found on docs. (I added some lines though, because I didnt want to open a new window, besides everything looks normal except I cant use haptic effects, like I can read values from the controller.), and I can see that SDL_NumHaptics()
is equal to 0 too, while debugging.
SDL_Haptic* haptic;
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
if (SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 1)
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER);
haptic = SDL_HapticOpen(0);
if (haptic == NULL)
return -1;
// Initialize simple rumble
if (SDL_HapticRumbleInit(haptic) != 0)
return -1;
// Play effect at 50% strength for 2 seconds
if (SDL_HapticRumblePlay(haptic, 0.5, 2000) != 0)
return -1;
No, you should use SDL_GameControllerRumble()
Thanks but SDL_GameControllerRumble(gGameController, 6000, 6000, 5000)
didn't seem to work either even it returns 0
Edit: I also found out in SDL_rawinputjoystick.c
, that since neither ctx->xinput_correlated
or ctx->wgi_correlated
is 1, the function doesnt do anything except returning 0.
Make sure you press a button on the controller before trying to rumble. That's how they get correlated.
Thank you, that was the thing I missed, after pressing any button it got correlated and successfully rumbled. Today or tomorrow I will use controllermap and post here to give additional information about share button's mapping on my controller
Hi, I was testing out the library, found out that the controller's share button event is fired as "SDL_JOYBUTTONDOWN/SDL_JOYBUTTONUP, button=11" instead of "SDL_CONTROLLER_BUTTON_MISC1". I am not sure if HIDP is available on Windows but for some reason the controller isnt even recognized as XINPUT, at least by the program, because 14th char of the GUID is 'r' which means raw input according to the library, even though it is visible as XINPUT on device manager, I couldnt go in deep that why it is being read as 'raw input' instead of 'xinput'. But I'd like to provide information as much I can :) And yes, firmware of the controller is up to date.
Windows 10 Pro 21H1 Xbox Wireless Controller (9th gen, Xbox Series S|X Controller)