I am trying to figure out if SetCooperativeLevel is still available in DX11. If it is no longer supported, what is the new API to get exclusive input from input device? Thanks.
1 Answers
The last version of DirectInput was DirectInput8. It has not been significantly changed since then. Use of DirectInput to handle keyboard and mouse is not recommended, use the Win32 messages instead. For legacy gamepads and joysticks, you can continue to use DirectInput for Win32 desktop apps, but it is not available for Windows Store, Windows phone, or Xbox One apps.
For Xbox 360 Common Controllers on Windows, you should use XINPUT. See GamePad in DirectX Tool Kit for a nice helper for using it for gamepads.
PS: For Some details on XInput 1.4 on Windows 8.0 and later vs. XInput 1.3 on Windows 7 et all, see this post.
To handle 'input focus' you should monitor the Win32 message WM_ACTIVATEAPP
. If wParam is TRUE, then you are foreground. If wParam is FALSE, then you are losing focus.

- 38,259
- 2
- 58
- 81