Fix stuck keys after toggle fullscreen

This commit is contained in:
Chris Danford
2003-06-22 04:38:05 +00:00
parent a7c88d569e
commit ae2be8a170
3 changed files with 15 additions and 3 deletions
+5
View File
@@ -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));
+1
View File
@@ -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 );
+9 -3
View File
@@ -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
} }