diff options
author | nicm <nicm> | 2017-06-23 15:36:52 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-06-23 15:36:52 +0000 |
commit | 95ed7d48c84198da0ec4b1b9b5de9358a47da753 (patch) | |
tree | 5b6515359ef39b43aae547292172ce20a17e160b /tty-keys.c | |
parent | a67df177634f5ff3f6a24598d4016f61a794af62 (diff) | |
download | rtmux-95ed7d48c84198da0ec4b1b9b5de9358a47da753.tar.gz rtmux-95ed7d48c84198da0ec4b1b9b5de9358a47da753.tar.bz2 rtmux-95ed7d48c84198da0ec4b1b9b5de9358a47da753.zip |
Add user-keys option to allow user-defined keys to be set, from Dan
Aloni.
Diffstat (limited to 'tty-keys.c')
-rw-r--r-- | tty-keys.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -389,8 +389,9 @@ tty_keys_build(struct tty *tty) { const struct tty_default_key_raw *tdkr; const struct tty_default_key_code *tdkc; - u_int i; - const char *s; + u_int i, size; + const char *s, *value; + struct options_entry *o; if (tty->key_tree != NULL) tty_keys_free(tty); @@ -411,6 +412,15 @@ tty_keys_build(struct tty *tty) tty_keys_add(tty, s, tdkc->key); } + + o = options_get(global_options, "user-keys"); + if (o != NULL && options_array_size(o, &size) != -1) { + for (i = 0; i < size; i++) { + value = options_array_get(o, i); + if (value != NULL) + tty_keys_add(tty, value, KEYC_USER + i); + } + } } /* Free the entire key tree. */ |