Changeset 1240 for code/branches/input/src/core/SignalHandler.cc
- Timestamp:
- May 6, 2008, 4:51:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.