mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Fixed bug 2368 - Security Software is blocking RegisterRawInputDevices()
Yamagi A customer of mine had the strange problem, that SDL_SetRelativeMouseMode() was failing for him on Windows 7. Luckily he was willing to provide some debug informations. We could track this problem down to RegisterRawInputDevices() failing due to security software running on his system (Norton Internet Security to be precise, but there are reports of similar problems with other products. For example [1]). Working around this issue with SDL_WarpMouseInWindow() is easy, and while I don't think that SDL2 can provide an internal workaround it would be really nice and helpfull if this could be documentated somewhere. 1: http://forums.codeguru.com/showthread.php?498374-How-to-run-a-very-long-SQL-statement
This commit is contained in:
parent
e663b4eb76
commit
c916f388d4
@ -538,7 +538,10 @@ SDL_SetRelativeMouseMode(SDL_bool enabled)
|
|||||||
} else if (enabled && ShouldUseRelativeModeWarp(mouse)) {
|
} else if (enabled && ShouldUseRelativeModeWarp(mouse)) {
|
||||||
mouse->relative_mode_warp = SDL_TRUE;
|
mouse->relative_mode_warp = SDL_TRUE;
|
||||||
} else if (mouse->SetRelativeMouseMode(enabled) < 0) {
|
} else if (mouse->SetRelativeMouseMode(enabled) < 0) {
|
||||||
return -1;
|
if (enabled) {
|
||||||
|
// Fall back to warp mode if native relative mode failed
|
||||||
|
mouse->relative_mode_warp = SDL_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mouse->relative_mode = enabled;
|
mouse->relative_mode = enabled;
|
||||||
|
|
||||||
|
@ -210,8 +210,8 @@ WIN_SetRelativeMouseMode(SDL_bool enabled)
|
|||||||
/* (Un)register raw input for mice */
|
/* (Un)register raw input for mice */
|
||||||
if (RegisterRawInputDevices(&rawMouse, 1, sizeof(RAWINPUTDEVICE)) == FALSE) {
|
if (RegisterRawInputDevices(&rawMouse, 1, sizeof(RAWINPUTDEVICE)) == FALSE) {
|
||||||
|
|
||||||
/* Only return an error when registering. If we unregister and fail, then
|
/* Only return an error when registering. If we unregister and fail,
|
||||||
it's probably that we unregistered twice. That's OK. */
|
then it's probably that we unregistered twice. That's OK. */
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
return SDL_Unsupported();
|
return SDL_Unsupported();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user