From ae2be8a170d19a9528d6632379627e7abc012f57 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 22 Jun 2003 04:38:05 +0000 Subject: [PATCH] Fix stuck keys after toggle fullscreen --- stepmania/src/InputFilter.cpp | 5 +++++ stepmania/src/InputFilter.h | 1 + stepmania/src/StepMania.cpp | 12 +++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index d5f94010c4..94908095cf 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -18,6 +18,11 @@ InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program InputFilter::InputFilter() +{ + Reset(); +} + +void InputFilter::Reset() { memset(m_BeingHeld, 0, sizeof(m_BeingHeld)); diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index 491459f414..3d8ac1f9df 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -47,6 +47,7 @@ public: void ResetDevice( InputDevice dev ); InputFilter(); + void Reset(); void Update(float fDeltaTime); bool IsBeingPressed( DeviceInput di ); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 699af2790b..b06bb0a736 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -126,6 +126,15 @@ void ApplyGraphicOptions() /* Give the input handlers a chance to re-open devices as necessary. */ 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() @@ -396,9 +405,6 @@ RageDisplay *CreateDisplay() } catch(exception e) { error += e.what(); 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 }