[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.4 and 1.5

version 1.4, 2009/09/20 14:58:12 version 1.5, 2009/10/11 07:01:10
Line 27 
Line 27 
   
 void    tty_keys_add(struct tty *, const char *, int, int);  void    tty_keys_add(struct tty *, const char *, int, int);
 int     tty_keys_parse_xterm(struct tty *, char *, size_t, size_t *);  int     tty_keys_parse_xterm(struct tty *, char *, size_t, size_t *);
 int     tty_keys_parse_mouse(struct tty *, char *, size_t, size_t *, u_char *);  int     tty_keys_parse_mouse(char *, size_t, size_t *, struct mouse_event *);
   
 struct tty_key_ent {  struct tty_key_ent {
         enum tty_code_code      code;          enum tty_code_code      code;
Line 231 
Line 231 
 }  }
   
 int  int
 tty_keys_next(struct tty *tty, int *key, u_char *mouse)  tty_keys_next(struct tty *tty, int *key, struct mouse_event *mouse)
 {  {
         struct tty_key  *tk;          struct tty_key  *tk;
         struct timeval   tv;          struct timeval   tv;
Line 269 
Line 269 
         }          }
   
         /* Not found. Is this a mouse key press? */          /* Not found. Is this a mouse key press? */
         *key = tty_keys_parse_mouse(tty, buf, len, &size, mouse);          *key = tty_keys_parse_mouse(buf, len, &size, mouse);
         if (*key != KEYC_NONE) {          if (*key != KEYC_NONE) {
                 buffer_remove(tty->in, size);                  buffer_remove(tty->in, size);
                 goto found;                  goto found;
Line 331 
Line 331 
 }  }
   
 int  int
 tty_keys_parse_mouse(  tty_keys_parse_mouse(char *buf, size_t len, size_t *size, struct mouse_event *m)
     unused struct tty *tty, char *buf, size_t len, size_t *size, u_char *mouse)  
 {  {
         /*          /*
          * Mouse sequences are \033[M followed by three characters indicating           * Mouse sequences are \033[M followed by three characters indicating
Line 344 
Line 343 
                 return (KEYC_NONE);                  return (KEYC_NONE);
         *size = 6;          *size = 6;
   
         if (buf[3] < 32 || buf[4] < 33 || buf[5] < 33)          m->b = buf[3];
           m->x = buf[4];
           m->y = buf[5];
           if (m->b < 32 || m->x < 33 || m->y < 33)
                 return (KEYC_NONE);                  return (KEYC_NONE);
           m->b -= 32;
         mouse[0] = buf[3] - 32;          m->x -= 33;
         mouse[1] = buf[4] - 33;          m->y -= 33;
         mouse[2] = buf[5] - 33;  
         return (KEYC_MOUSE);          return (KEYC_MOUSE);
 }  }
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5