[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.26 and 1.27

version 1.26, 2009/12/01 07:59:40 version 1.27, 2009/12/03 22:50:10
Line 35 
Line 35 
 void            tty_keys_add(struct tty *, const char *, int);  void            tty_keys_add(struct tty *, const char *, int);
 void            tty_keys_free1(struct tty_key *);  void            tty_keys_free1(struct tty_key *);
 struct tty_key *tty_keys_find1(  struct tty_key *tty_keys_find1(
                     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(  int             tty_keys_mouse(
Line 50 
Line 50 
 #define TTYKEY_RAW 0x1  #define TTYKEY_RAW 0x1
 };  };
   
 /*  /*
  * Default key tables. Those flagged with TTYKEY_RAW are inserted directly,   * Default key tables. Those flagged with TTYKEY_RAW are inserted directly,
  * otherwise they are looked up in terminfo(5).   * otherwise they are looked up in terminfo(5).
  */   */
Line 319 
Line 319 
   
                 /* Use the child tree for the next character. */                  /* Use the child tree for the next character. */
                 tkp = &tk->next;                  tkp = &tk->next;
         } else {          } else {
                 if (*s < tk->ch)                  if (*s < tk->ch)
                         tkp = &tk->left;                          tkp = &tk->left;
                 else if (*s > tk->ch)                  else if (*s > tk->ch)
Line 374 
Line 374 
         if (tk->right != NULL)          if (tk->right != NULL)
                 tty_keys_free1(tk->right);                  tty_keys_free1(tk->right);
         xfree(tk);          xfree(tk);
   
 }  }
   
 /* Lookup a key in the tree. */  /* Lookup a key in the tree. */
Line 523 
Line 523 
         /* Start the timer and wait for expiry or more data. */          /* Start the timer and wait for expiry or more data. */
         tv.tv_sec = 0;          tv.tv_sec = 0;
         tv.tv_usec = ESCAPE_PERIOD * 1000L;          tv.tv_usec = ESCAPE_PERIOD * 1000L;
   
         evtimer_del(&tty->key_timer);          evtimer_del(&tty->key_timer);
         evtimer_set(&tty->key_timer, tty_keys_callback, tty);          evtimer_set(&tty->key_timer, tty_keys_callback, tty);
         evtimer_add(&tty->key_timer, &tv);          evtimer_add(&tty->key_timer, &tv);
   
         tty->flags |= TTY_ESCAPE;          tty->flags |= TTY_ESCAPE;
         return (0);          return (0);
   
Line 548 
Line 548 
         goto handle_key;          goto handle_key;
   
 handle_key:  handle_key:
         evtimer_del(&tty->key_timer);          evtimer_del(&tty->key_timer);
   
         tty->key_callback(key, &mouse, tty->key_data);          tty->key_callback(key, &mouse, tty->key_data);
   
Line 570 
Line 570 
                 ;                  ;
 }  }
   
 /*  /*
  * Handle mouse key input. Returns 0 for success, -1 for failure, 1 for partial   * Handle mouse key input. Returns 0 for success, -1 for failure, 1 for partial
  * (probably a mouse sequence but need more data).   * (probably a mouse sequence but need more data).
  */   */
Line 593 
Line 593 
                 return (-1);                  return (-1);
         if (len == 2)          if (len == 2)
                 return (1);                  return (1);
   
         if (buf[2] != 'M')          if (buf[2] != 'M')
                 return (-1);                  return (-1);
         if (len == 3)          if (len == 3)

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27