diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-02-27 21:55:39 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-16 20:42:19 +0100 |
commit | c647d540a702890e8b182b1640fdfa1bd94ced82 (patch) | |
tree | 4e05ba0e2086134d922bdf68f6aa03654940edad /src | |
parent | d1adec29f9af2ddbc3513a88314b298254417bb5 (diff) | |
download | weechat-c647d540a702890e8b182b1640fdfa1bd94ced82.zip |
core: remove obsolete function gui_key_legacy_expand
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/gui-key.c | 59 | ||||
-rw-r--r-- | src/gui/gui-key.h | 1 |
2 files changed, 0 insertions, 60 deletions
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 6b121912b..60af69e08 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -376,65 +376,6 @@ gui_key_legacy_internal_code (const char *key) } /* - * Gets expanded name from internal key code (legacy function). - * - * Examples: - * "\001j" => "ctrl-j" - * "\001m" => "ctrl-m" - * "\001r" => "ctrl-r" - * "\001[A" => "meta-A" - * "\001[a" => "meta-a" - * "\001[[1;3D" => "meta2-1;3D" - * "\001[w\001[[1;3A" => "meta-wmeta2-1;3A" - * - * Note: result must be freed after use. - */ - -char * -gui_key_legacy_expand (const char *key) -{ - char **result; - - if (!key) - return NULL; - - result = string_dyn_alloc ((strlen (key) * 2) + 1); - if (!result) - return NULL; - - while (key[0]) - { - if (strncmp (key, "\x01[[", 3) == 0) - { - string_dyn_concat (result, "meta2-", -1); - key += 3; - } - if (strncmp (key, "\x01[", 2) == 0) - { - string_dyn_concat (result, "meta-", -1); - key += 2; - } - else if ((key[0] == '\x01') && (key[1])) - { - string_dyn_concat (result, "ctrl-", -1); - key++; - } - else if (key[0] == ' ') - { - string_dyn_concat (result, "space", -1); - key++; - } - else - { - string_dyn_concat (result, key, 1); - key++; - } - } - - return string_dyn_free (result, 0); -} - -/* * Expands raw key code to its name and name using aliases (human readable * key name). * diff --git a/src/gui/gui-key.h b/src/gui/gui-key.h index c28658761..fed8ca750 100644 --- a/src/gui/gui-key.h +++ b/src/gui/gui-key.h @@ -92,7 +92,6 @@ extern void gui_key_init (); extern int gui_key_search_context (const char *context); extern void gui_key_grab_init (int grab_raw_key, int grab_command, const char *delay); -extern char *gui_key_legacy_expand (const char *key); extern int gui_key_expand (const char *key, char **key_name, char **key_name_alias); extern char *gui_key_legacy_to_alias (const char *key); |