diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-07-15 19:04:00 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-07-15 19:04:00 +0200 |
commit | 7389514c0977f3c85faf0cd52db5b9e9759cc5f6 (patch) | |
tree | 8b3a94f60c3f9b15b986b402088da28135f5b1e5 /src/core/wee-command.c | |
parent | 92609e3cd631e491617e0d2ac3b6a129976395cc (diff) | |
download | weechat-7389514c0977f3c85faf0cd52db5b9e9759cc5f6.zip |
core: add option weechat.look.key_bind_safe
Diffstat (limited to 'src/core/wee-command.c')
-rw-r--r-- | src/core/wee-command.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 133646047..3daf55edc 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -2876,6 +2876,19 @@ COMMAND_CALLBACK(key) } /* bind new key */ + if (CONFIG_BOOLEAN(config_look_key_bind_safe) + && !gui_key_is_safe (GUI_KEY_CONTEXT_DEFAULT, argv[2])) + { + gui_chat_printf (NULL, + _("%sError: it is not safe to bind key \"%s\" because " + "it does not start with a ctrl or meta code (tip: " + "use alt-k to find key codes); if you want to " + "bind this key anyway, turn off option " + "weechat.look.key_bind_safe"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[2]); + return WEECHAT_RC_OK; + } gui_key_verbose = 1; ptr_new_key = gui_key_bind (NULL, GUI_KEY_CONTEXT_DEFAULT, argv[2], argv_eol[3]); @@ -2932,6 +2945,19 @@ COMMAND_CALLBACK(key) } /* bind new key */ + if (CONFIG_BOOLEAN(config_look_key_bind_safe) + && !gui_key_is_safe (GUI_KEY_CONTEXT_DEFAULT, argv[3])) + { + gui_chat_printf (NULL, + _("%sError: it is not safe to bind key \"%s\" because " + "it does not start with a ctrl or meta code (tip: " + "use alt-k to find key codes); if you want to " + "bind this key anyway, turn off option " + "weechat.look.key_bind_safe"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[3]); + return WEECHAT_RC_OK; + } gui_key_verbose = 1; ptr_new_key = gui_key_bind (NULL, context, argv[3], argv_eol[4]); |