1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

core: use new key name in command /key and configuration file

Legacy keys are automatically converted to new names when loading configuration
file `weechat.conf`.

Examples:

  "ctrl-I" => "tab"
  "meta2-1;3A" => "meta-up"
  "meta2-Z" => "shift-tab"
  "meta-wmeta-meta2-A" => "meta-w,meta-up"
  "ctrl-Cb" => "ctrl-c,b"
This commit is contained in:
Sébastien Helleu
2023-02-22 21:18:22 +01:00
parent 5b5ccb236f
commit 1f5c791c37
22 changed files with 654 additions and 552 deletions
+14 -12
View File
@@ -1090,21 +1090,23 @@ script_buffer_set_callbacks ()
void
script_buffer_set_keys ()
{
char *keys[][2] = { { "meta-A", "toggleautoload" },
{ "meta-l", "load" },
{ "meta-u", "unload" },
{ "meta-L", "reload" },
{ "meta-i", "install" },
{ "meta-r", "remove" },
{ "meta-h", "hold" },
{ "meta-v", "show" },
{ "meta-d", "showdiff" },
{ NULL, NULL } };
char *keys[][2] = {
{ "meta-A", "toggleautoload" },
{ "meta-l", "load" },
{ "meta-u", "unload" },
{ "meta-L", "reload" },
{ "meta-i", "install" },
{ "meta-r", "remove" },
{ "meta-h", "hold" },
{ "meta-v", "show" },
{ "meta-d", "showdiff" },
{ NULL, NULL },
};
char str_key[64], str_command[64];
int i;
weechat_buffer_set (script_buffer, "key_bind_meta2-A", "/script up");
weechat_buffer_set (script_buffer, "key_bind_meta2-B", "/script down");
weechat_buffer_set (script_buffer, "key_bind_up", "/script up");
weechat_buffer_set (script_buffer, "key_bind_down", "/script down");
for (i = 0; keys[i][0]; i++)
{
if (weechat_config_boolean (script_config_look_use_keys))