diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-23 10:01:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-23 10:01:34 +0000 |
commit | ee0f8adfac76cdf21cfd2c0b503d8d66dcb883cc (patch) | |
tree | 1a01c4d91d47e46fabc6782240dc0c0a8e58218f /tty-keys.c | |
parent | 1ed37385c66cbfe9221e9ee4025105a5370d1ef2 (diff) | |
download | rtmux-ee0f8adfac76cdf21cfd2c0b503d8d66dcb883cc.tar.gz rtmux-ee0f8adfac76cdf21cfd2c0b503d8d66dcb883cc.tar.bz2 rtmux-ee0f8adfac76cdf21cfd2c0b503d8d66dcb883cc.zip |
Handle focus events from the terminal, from Aaron Jensen.
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); |