Change which player the Xbox controller represents?
Does anyone know if there is a way to change which portion of the ring is lit 开发者_开发百科on the Xbox controller? For instance, I want the first controller to be plugged in to represent player 2 (if player 1 opts to use keyboard/mouse input)
Thanks.
Use XInputRemap to remap the connected controllers to the users associated with those controllers. This is part of the XInput API. So if you have 2 players and want to swap their controller:
DWORD remap[XUSER_MAX_COUNT];
remap[0] = 1;
remap[1] = 0;
DWORD dwResult = XInputRemap(remap);
The SDK includes a sample the demonstrates this function.
精彩评论