diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-23 13:03:47 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-23 13:03:47 +0000 |
commit | 57eb334d5b989642c84b974908c43c729983d1b8 (patch) | |
tree | 5600670a3688454d211b34ff8d45419bcd06d94c /tty-keys.c | |
parent | 5f904aa35002246ee1005e3849455ccbdc321781 (diff) | |
parent | ee0f8adfac76cdf21cfd2c0b503d8d66dcb883cc (diff) | |
download | rtmux-57eb334d5b989642c84b974908c43c729983d1b8.tar.gz rtmux-57eb334d5b989642c84b974908c43c729983d1b8.tar.bz2 rtmux-57eb334d5b989642c84b974908c43c729983d1b8.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'tty-keys.c')
-rw-r--r-- | tty-keys.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -174,6 +174,10 @@ const struct tty_default_key_raw tty_default_raw_keys[] = { { "\033[8@", KEYC_END|KEYC_CTRL|KEYC_SHIFT }, { "\033[6@", KEYC_NPAGE|KEYC_CTRL|KEYC_SHIFT }, { "\033[5@", KEYC_PPAGE|KEYC_CTRL|KEYC_SHIFT }, + + /* Focus tracking. */ + { "\033[I", KEYC_FOCUS_IN }, + { "\033[O", KEYC_FOCUS_OUT }, }; /* Default terminfo(5) keys. */ @@ -559,6 +563,15 @@ complete_key: evtimer_del(&tty->key_timer); tty->flags &= ~TTY_TIMER; + /* Check for focus events. */ + if (key == KEYC_FOCUS_OUT) { + tty->client->flags &= ~CLIENT_FOCUSED; + return (1); + } else if (key == KEYC_FOCUS_IN) { + tty->client->flags |= CLIENT_FOCUSED; + return (1); + } + /* Fire the key. */ if (key != KEYC_NONE) server_client_handle_key(tty->client, key); |