Changeset 1240
- Timestamp:
- May 6, 2008, 4:51:32 PM (17 years ago)
- Location:
- code/branches/input/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/CorePrereqs.h
r1238 r1240 149 149 class InputManager; 150 150 class JoyStickHandler; 151 class JoyStickState;152 151 class KeyBinder; 153 class KeyEvent;154 152 class KeyHandler; 155 153 class MouseHandler; 156 class MouseState;157 154 158 155 } -
code/branches/input/src/core/SignalHandler.cc
r1238 r1240 44 44 45 45 #include <wait.h> 46 #include <X11/Xlib.h> 47 #include <X11/Xutil.h> 48 #include <X11/keysym.h> 49 50 bool SignalHandler::bXAutoKeyRepeatOn_ = false; 46 51 47 52 SignalHandler::SignalHandler() … … 60 65 61 66 // prepare for restoring XAutoKeyRepeat 62 if (display_ = XOpenDisplay(0)) 63 { 64 XGetKeyboardControl( display_, &bXAutoKeyRepeatOn_ ); 65 XCloseDisplay(display_); 67 Display* display; 68 if ((display = XOpenDisplay(0))) 69 { 70 XKeyboardState oldState; 71 XGetKeyboardControl(display, &oldState); 72 if (oldState.global_auto_repeat == AutoRepeatModeOn) 73 bXAutoKeyRepeatOn_ = true; 74 else 75 bXAutoKeyRepeatOn_ = false; 76 XCloseDisplay(display); 66 77 } 67 78 else 68 79 { 69 80 std::cout << "Warning: couldn't open X display to restore XAutoKeyRepeat." << std::endl; 70 XAutoKeyRepeatOn_ = false;81 bXAutoKeyRepeatOn_ = false; 71 82 } 72 83 … … 136 147 } 137 148 138 if ( XAutoKeyRepeatOn_)149 if (bXAutoKeyRepeatOn_) 139 150 { 140 151 std::cout << "Trying to restore XAutoKeyRepeat" << std::endl; 141 if (display_ = XOpenDisplay(0)) 142 { 143 XAutoRepeatOn(display_); 144 XCloseDisplay(display_); 152 Display* display; 153 if ((display = XOpenDisplay(0))) 154 { 155 XAutoRepeatOn(display); 156 XCloseDisplay(display); 145 157 } 146 158 } -
code/branches/input/src/core/SignalHandler.h
r1238 r1240 44 44 #ifndef __WIN32__ 45 45 #include <signal.h> 46 #include <X11/Xlib.h>47 46 48 47 struct SignalRec … … 88 87 std::string fileName; 89 88 90 // X Display, used to turn on KeyAutoRepeat if OIS crashes 91 Display *display_; 92 bool bXAutoKeyRepeatOn_; 89 // used to turn on KeyAutoRepeat if OIS crashes 90 static bool bXAutoKeyRepeatOn_; 93 91 }; 94 92
Note: See TracChangeset
for help on using the changeset viewer.