From 37c6621bd74794ebd2b84d74f3ee94c0966af0e1 Mon Sep 17 00:00:00 2001 From: Sean Burke Date: Wed, 16 Mar 2005 05:23:20 +0000 Subject: [PATCH] A far more elegant solution, and one that allows the problem to be solved after a crash by restarting and exiting --- .../src/arch/InputHandler/InputHandler_X11.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_X11.cpp b/stepmania/src/arch/InputHandler/InputHandler_X11.cpp index 8f61183672..26264a296e 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_X11.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_X11.cpp @@ -8,8 +8,6 @@ #include #include -XKeyboardState prev_state; - static RageKeySym XSymToKeySym( int key ) { #define KEY_INV KEY_INVALID @@ -113,19 +111,18 @@ static RageKeySym XSymToKeySym( int key ) InputHandler_X11::InputHandler_X11() { - XKeyboardControl new_state; - new_state.auto_repeat_mode = AutoRepeatModeOff; + XKeyboardControl state; + state.auto_repeat_mode = AutoRepeatModeOff; + XChangeKeyboardControl(X11Helper::Dpy,KBAutoRepeatMode,&state); X11Helper::Go(); X11Helper::OpenMask(KeyPressMask); X11Helper::OpenMask(KeyReleaseMask); - XGetKeyboardControl(X11Helper::Dpy,&prev_state); - XChangeKeyboardControl(X11Helper::Dpy,KBAutoRepeatMode,&new_state); } InputHandler_X11::~InputHandler_X11() { - XKeyboardControl end_state; - end_state.auto_repeat_mode = prev_state.global_auto_repeat; - XChangeKeyboardControl(X11Helper::Dpy,KBAutoRepeatMode,&end_state); + XKeyboardControl state; + state.auto_repeat_mode = AutoRepeatModeDefault; + XChangeKeyboardControl(X11Helper::Dpy,KBAutoRepeatMode,&state); X11Helper::CloseMask(KeyPressMask); X11Helper::CloseMask(KeyReleaseMask); X11Helper::Stop(); }