[BACK]Return to tty-keys.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/tty-keys.c between version 1.39 and 1.40

version 1.39, 2012/04/22 05:21:40 version 1.40, 2012/05/22 14:11:30
Line 40 
Line 40 
                     struct tty_key *, const char *, size_t, size_t *);                      struct tty_key *, const char *, size_t, size_t *);
 struct tty_key *tty_keys_find(struct tty *, const char *, size_t, size_t *);  struct tty_key *tty_keys_find(struct tty *, const char *, size_t, size_t *);
 void            tty_keys_callback(int, short, void *);  void            tty_keys_callback(int, short, void *);
 int             tty_keys_mouse(struct tty *,  int             tty_keys_mouse(struct tty *, const char *, size_t, size_t *);
                     const char *, size_t, size_t *, struct mouse_event *);  
 int             tty_keys_device(struct tty *, const char *, size_t, size_t *);  int             tty_keys_device(struct tty *, const char *, size_t, size_t *);
   
 struct tty_key_ent {  struct tty_key_ent {
Line 434 
Line 433 
 int  int
 tty_keys_next(struct tty *tty)  tty_keys_next(struct tty *tty)
 {  {
         struct tty_key          *tk;          struct tty_key  *tk;
         struct timeval           tv;          struct timeval   tv;
         struct mouse_event       mouse;          const char      *buf;
         const char              *buf;          size_t           len, size;
         size_t                   len, size;          cc_t             bspace;
         cc_t                     bspace;          int              key, delay;
         int                      key, delay;  
   
         buf = EVBUFFER_DATA(tty->event->input);          buf = EVBUFFER_DATA(tty->event->input);
         len = EVBUFFER_LENGTH(tty->event->input);          len = EVBUFFER_LENGTH(tty->event->input);
Line 477 
Line 475 
         }          }
   
         /* Is this a mouse key press? */          /* Is this a mouse key press? */
         switch (tty_keys_mouse(tty, buf, len, &size, &mouse)) {          switch (tty_keys_mouse(tty, buf, len, &size)) {
         case 0:         /* yes */          case 0:         /* yes */
                 evbuffer_drain(tty->event->input, size);                  evbuffer_drain(tty->event->input, size);
                 key = KEYC_MOUSE;                  key = KEYC_MOUSE;
Line 582 
Line 580 
                 evtimer_del(&tty->key_timer);                  evtimer_del(&tty->key_timer);
   
         if (key != KEYC_NONE)          if (key != KEYC_NONE)
                 tty->key_callback(key, &mouse, tty->key_data);                  tty->key_callback(key, &tty->mouse_event, tty->key_data);
   
         tty->flags &= ~TTY_ESCAPE;          tty->flags &= ~TTY_ESCAPE;
         return (1);          return (1);
Line 607 
Line 605 
  * (probably a mouse sequence but need more data).   * (probably a mouse sequence but need more data).
  */   */
 int  int
 tty_keys_mouse(struct tty *tty,  tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size)
     const char *buf, size_t len, size_t *size, struct mouse_event *m)  
 {  {
         struct utf8_data        utf8data;          struct mouse_event      *m = &tty->mouse_event;
         u_int                   i, value;          struct utf8_data         utf8data;
           u_int                    i, value;
   
         /*          /*
          * Standard mouse sequences are \033[M followed by three characters           * Standard mouse sequences are \033[M followed by three characters

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40