-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: Gamepad not detected due to window handler definition error #2826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Add window handler
fixes SharpDX error
fix window descriptor
fix: Gamepad not detected due to window handle definition error
@dotnet-policy-service agree |
@@ -16,6 +16,9 @@ internal static class Win32 | |||
|
|||
[DllImport("user32.dll")] | |||
public static extern void ClipCursor(IntPtr rect); | |||
|
|||
[DllImport("user32.dll")] | |||
public static extern IntPtr GetForegroundWindow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How reliable is this to always get the game window? If there is a possibility that the game window may not be in focus, there may be a better way to do this with a GameWindow
reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. It doesn't really matter how we get the Window handler, gamepad working with SharpDX.DirectInput
depends from the CooperativeLevel
mode. It seems that if I can make CooperativeLevel
work in Exclusive
mode, it will allow ForceFeedback to work. At the moment, Exclusive
mode will crash Stride.Input
when window not in a focus. I will try your recomendation.
Converting this to draft while the contributor gets back to us |
Sorry for the long delay. I can't get back now gamepads from true gamers. I hope to return to this PR in 2-3 months |
PR Details
When connecting a Logitech RumblePad II gamepad,
SharpDX.DirectInput
returns an error related to an invalid window identifier.Related Issue
#1791
Types of changes
Checklist