Changeset 273 for libcaca/trunk/src/io.c
- Timestamp:
- Dec 24, 2003, 4:35:07 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/io.c
r269 r273 129 129 #endif 130 130 131 /* If it's already a special event, return it */ 132 if((keybuf[0] & ~0xff) != 0) 133 return _pop_key(); 134 135 /* If it's not an escape sequence, return the key */ 131 136 if(keybuf[0] != '\x1b') 132 137 return CACA_EVENT_KEY_PRESS | _pop_key(); … … 248 253 #if defined(USE_X11) 249 254 XEvent event; 255 static int x11_x = 0, x11_y = 0; 256 long int event_mask = KeyPressMask | ButtonPressMask | PointerMotionMask; 250 257 char key; 251 258 #endif … … 268 275 #if defined(USE_X11) 269 276 case CACA_DRIVER_X11: 270 while(XCheckWindowEvent(x11_dpy, x11_window, KeyPressMask, &event)277 while(XCheckWindowEvent(x11_dpy, x11_window, event_mask, &event) 271 278 == True) 272 279 { 273 280 KeySym keysym; 281 282 if(event.type == MotionNotify) 283 { 284 x11_x = event.xmotion.x; 285 x11_y = event.xmotion.y; 286 continue; 287 } 288 289 if(event.type == ButtonPress) 290 { 291 unsigned int x = x11_x / x11_font_width; 292 unsigned int y = x11_y / x11_font_height; 293 294 if(x >= _caca_width) 295 x = _caca_width - 1; 296 if(y >= _caca_height) 297 y = _caca_height - 1; 298 299 return CACA_EVENT_MOUSE_CLICK 300 | (1 << 16) | (x << 8) | (y << 0); 301 } 274 302 275 303 if(event.type != KeyPress)
Note: See TracChangeset
for help on using the changeset viewer.