Fix stuck keys after toggle fullscreen
This commit is contained in:
@@ -18,6 +18,11 @@
|
|||||||
InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program
|
InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program
|
||||||
|
|
||||||
InputFilter::InputFilter()
|
InputFilter::InputFilter()
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputFilter::Reset()
|
||||||
{
|
{
|
||||||
memset(m_BeingHeld, 0, sizeof(m_BeingHeld));
|
memset(m_BeingHeld, 0, sizeof(m_BeingHeld));
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public:
|
|||||||
void ResetDevice( InputDevice dev );
|
void ResetDevice( InputDevice dev );
|
||||||
|
|
||||||
InputFilter();
|
InputFilter();
|
||||||
|
void Reset();
|
||||||
void Update(float fDeltaTime);
|
void Update(float fDeltaTime);
|
||||||
|
|
||||||
bool IsBeingPressed( DeviceInput di );
|
bool IsBeingPressed( DeviceInput di );
|
||||||
|
|||||||
@@ -126,6 +126,15 @@ void ApplyGraphicOptions()
|
|||||||
|
|
||||||
/* Give the input handlers a chance to re-open devices as necessary. */
|
/* Give the input handlers a chance to re-open devices as necessary. */
|
||||||
INPUTMAN->WindowReset();
|
INPUTMAN->WindowReset();
|
||||||
|
|
||||||
|
// Input events are lost while the graphics window is
|
||||||
|
// destroyed and re-created. Reset all held keys so that
|
||||||
|
// keys don't appear to be stuck down - particularly
|
||||||
|
// Alt after Alt+Enter. This would make more sense in
|
||||||
|
// InputHandler::WindowReset(), but I figure that it's
|
||||||
|
// something that every InputHandler would need to do
|
||||||
|
// anyway. -Chris
|
||||||
|
INPUTFILTER->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitGame()
|
void ExitGame()
|
||||||
@@ -396,9 +405,6 @@ RageDisplay *CreateDisplay()
|
|||||||
} catch(exception e) {
|
} catch(exception e) {
|
||||||
error += e.what();
|
error += e.what();
|
||||||
error += "\n\n";
|
error += "\n\n";
|
||||||
} catch(RageException_D3DNoAcceleration e) {
|
|
||||||
error += "Your system is reporting that Direct3D hardware acceleration is not available. "
|
|
||||||
"Please obtain an updated driver from your video card manufacturer.\n\n";
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user