Changeset 289 for libcaca/trunk/src/io.c
- Timestamp:
- Dec 31, 2003, 12:17:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/io.c
r287 r289 87 87 if(xevent.type == MotionNotify) 88 88 { 89 unsigned int x = xevent.xmotion.x / x11_font_width;90 unsigned int y = xevent.xmotion.y / x11_font_height;91 92 if(x11_x == x && x11_y ==y)89 unsigned int newx = xevent.xmotion.x / x11_font_width; 90 unsigned int newy = xevent.xmotion.y / x11_font_height; 91 92 if(x11_x == newx && x11_y == newy) 93 93 continue; 94 94 95 if( x >= _caca_width)96 x = _caca_width - 1;97 if( y >= _caca_height)98 y = _caca_height - 1;99 100 x11_x = x & 0xfff;101 x11_y = y & 0xfff;102 103 return CACA_EVENT_MOUSE_MOTION | ( x << 12) | (y << 0);95 if(newx >= _caca_width) 96 newx = _caca_width - 1; 97 if(newy >= _caca_height) 98 newy = _caca_height - 1; 99 100 x11_x = newx & 0xfff; 101 x11_y = newy & 0xfff; 102 103 return CACA_EVENT_MOUSE_MOTION | (newx << 12) | (newy << 0); 104 104 } 105 105 … … 171 171 _pop_key(); 172 172 getmouse(&mevent); 173 174 event |= (1) << 16; 175 event |= (mevent.x) << 8; 176 event |= (mevent.y) << 0; 177 178 return CACA_EVENT_MOUSE_PRESS | event; 173 _push_key(CACA_EVENT_MOUSE_PRESS | 1); 174 return CACA_EVENT_MOUSE_MOTION 175 | (mevent.x << 12) | (mevent.y << 0); 179 176 } 180 177 … … 244 241 _pop_key(); 245 242 _pop_key(); 246 event |= (_pop_key() - ' ') << 16; 247 event |= (_pop_key() - '!') << 8; 248 event |= (_pop_key() - '!') << 0; 249 250 return CACA_EVENT_MOUSE_PRESS | event; 243 _push_key(CACA_EVENT_MOUSE_PRESS | (_pop_key() - ' ')); 244 return CACA_EVENT_MOUSE_MOTION 245 | ((_pop_key() - '!') << 12) | ((_pop_key() - '!') << 0); 251 246 } 252 247 else if(keybuf[0] == '[' && keybuf[1] == '1' && keybuf[3] == '~' &&
Note: See TracChangeset
for help on using the changeset viewer.