mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
core: display actual key name and command with key Alt+k
Key Alt+K (upper K) is removed as well as commands `/input grab_raw_key` and `/input grab_raw_key_command`.
This commit is contained in:
@@ -16,6 +16,7 @@ For a list of important changes that require manual actions, please look at rele
|
||||
Bug fixes::
|
||||
|
||||
* core: force key "return" to command "/input return" when migrating legacy keys
|
||||
* core: display actual key name and command with key kbd:[Alt+k], remove key kbd:[Alt+K] (grab raw key) and associated commands `/input grab_raw_key` and `/input grab_raw_key_command`
|
||||
* irc: reply to a CTCP request sent to self nick (issue #1966)
|
||||
|
||||
[[v4.0.0]]
|
||||
|
||||
@@ -11,6 +11,18 @@ It is recommended to read it when upgrading to a new stable version. +
|
||||
For a complete list of changes, please look at ChangeLog.
|
||||
|
||||
|
||||
[[v4.0.1]]
|
||||
== Version 4.0.1 (under dev)
|
||||
|
||||
[[v4.0.1_grab_raw_key]]
|
||||
==== Grab raw key and command
|
||||
|
||||
Key kbd:[Alt+K] (upper case) has been removed, as well as commands
|
||||
`/input grab_raw_key` and `/input grab_raw_key_command`.
|
||||
|
||||
Now the key kbd:[Alt+k] displays the actual key name and command, possibly
|
||||
raw key.
|
||||
|
||||
[[v4.0.0]]
|
||||
== Version 4.0.0 (2023-06-24)
|
||||
|
||||
|
||||
+1
-17
@@ -3534,28 +3534,12 @@ COMMAND_CALLBACK(input)
|
||||
else if (string_strcmp (argv[1], "grab_key") == 0)
|
||||
{
|
||||
gui_input_grab_key (buffer,
|
||||
0, /* raw_key */
|
||||
0, /* command */
|
||||
(argc > 2) ? argv[2] : NULL);
|
||||
}
|
||||
else if (string_strcmp (argv[1], "grab_raw_key") == 0)
|
||||
{
|
||||
gui_input_grab_key (buffer,
|
||||
1, /* raw_key */
|
||||
0, /* command */
|
||||
(argc > 2) ? argv[2] : NULL);
|
||||
}
|
||||
else if (string_strcmp (argv[1], "grab_key_command") == 0)
|
||||
{
|
||||
gui_input_grab_key (buffer,
|
||||
0, /* raw_key */
|
||||
1, /* command */
|
||||
(argc > 2) ? argv[2] : NULL);
|
||||
}
|
||||
else if (string_strcmp (argv[1], "grab_raw_key_command") == 0)
|
||||
{
|
||||
gui_input_grab_key (buffer,
|
||||
1, /* raw_key */
|
||||
1, /* command */
|
||||
(argc > 2) ? argv[2] : NULL);
|
||||
}
|
||||
@@ -8433,7 +8417,7 @@ command_init ()
|
||||
"move_next_word || move_previous_line || move_next_line || "
|
||||
"history_previous || history_next || history_global_previous || "
|
||||
"history_global_next || "
|
||||
"grab_key || grab_raw_key || grab_raw_key_command || grab_key_command || "
|
||||
"grab_key || grab_key_command || "
|
||||
"grab_mouse || grab_mouse_area || "
|
||||
"insert || send",
|
||||
&command_input, NULL, NULL);
|
||||
|
||||
@@ -134,7 +134,6 @@ gui_key_default_bindings (int context, int create_option)
|
||||
BIND("meta-h,meta-r", "/hotlist restore");
|
||||
BIND("meta-h,meta-R", "/hotlist restore -all");
|
||||
BIND("meta-k", "/input grab_key_command");
|
||||
BIND("meta-K", "/input grab_raw_key_command");
|
||||
BIND("meta-s", "/mute spell toggle");
|
||||
BIND("meta-u", "/window scroll_unread");
|
||||
BIND("ctrl-s,ctrl-u", "/allbuf /buffer set unread");
|
||||
|
||||
+2
-3
@@ -1729,11 +1729,10 @@ gui_input_history_global_next (struct t_gui_buffer *buffer)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_grab_key (struct t_gui_buffer *buffer, int raw_key, int command,
|
||||
const char *delay)
|
||||
gui_input_grab_key (struct t_gui_buffer *buffer, int command, const char *delay)
|
||||
{
|
||||
if (buffer->input)
|
||||
gui_key_grab_init (raw_key, command, delay);
|
||||
gui_key_grab_init (command, delay);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -78,8 +78,8 @@ extern void gui_input_history_local_previous (struct t_gui_buffer *buffer);
|
||||
extern void gui_input_history_local_next (struct t_gui_buffer *buffer);
|
||||
extern void gui_input_history_global_previous (struct t_gui_buffer *buffer);
|
||||
extern void gui_input_history_global_next (struct t_gui_buffer *buffer);
|
||||
extern void gui_input_grab_key (struct t_gui_buffer *buffer, int raw_key,
|
||||
int command, const char *delay);
|
||||
extern void gui_input_grab_key (struct t_gui_buffer *buffer, int command,
|
||||
const char *delay);
|
||||
extern void gui_input_grab_mouse (struct t_gui_buffer *buffer, int area);
|
||||
extern void gui_input_insert (struct t_gui_buffer *buffer, const char *args);
|
||||
extern void gui_input_undo (struct t_gui_buffer *buffer);
|
||||
|
||||
+15
-18
@@ -87,7 +87,6 @@ int gui_key_verbose = 0; /* 1 to see some messages */
|
||||
|
||||
char gui_key_combo[1024]; /* buffer used for combos */
|
||||
int gui_key_grab = 0; /* 1 if grab mode enabled (alt-k) */
|
||||
int gui_key_grab_raw = 0; /* grab raw key code? */
|
||||
int gui_key_grab_count = 0; /* number of keys pressed in grab mode */
|
||||
int gui_key_grab_command = 0; /* grab command bound to key? */
|
||||
int gui_key_grab_delay = 0; /* delay for grab (default is 500) */
|
||||
@@ -185,13 +184,12 @@ gui_key_get_current_context ()
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_grab_init (int grab_raw_key, int grab_command, const char *delay)
|
||||
gui_key_grab_init (int grab_command, const char *delay)
|
||||
{
|
||||
long milliseconds;
|
||||
char *error;
|
||||
|
||||
gui_key_grab = 1;
|
||||
gui_key_grab_raw = grab_raw_key;
|
||||
gui_key_grab_count = 0;
|
||||
gui_key_grab_command = grab_command;
|
||||
|
||||
@@ -217,8 +215,7 @@ int
|
||||
gui_key_grab_end_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
{
|
||||
char *key_name, *key_name_alias, *key_utf8;
|
||||
const char *ptr_key_name;
|
||||
struct t_gui_key *ptr_key;
|
||||
struct t_gui_key *ptr_key_raw, *ptr_key;
|
||||
int rc;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -264,23 +261,23 @@ gui_key_grab_end_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
}
|
||||
}
|
||||
|
||||
ptr_key_name = (gui_key_grab_raw) ? key_name : key_name_alias;
|
||||
|
||||
/* add expanded key to input buffer */
|
||||
if (gui_current_window->buffer->input)
|
||||
{
|
||||
gui_input_insert_string (gui_current_window->buffer, ptr_key_name);
|
||||
if (gui_key_grab_command)
|
||||
ptr_key_raw = gui_key_search (gui_keys[GUI_KEY_CONTEXT_DEFAULT],
|
||||
key_name);
|
||||
ptr_key = gui_key_search (gui_keys[GUI_KEY_CONTEXT_DEFAULT],
|
||||
key_name_alias);
|
||||
gui_input_insert_string (gui_current_window->buffer,
|
||||
(ptr_key_raw) ? key_name : key_name_alias);
|
||||
/* add command bound to key (if found) */
|
||||
if (gui_key_grab_command && (ptr_key_raw || ptr_key))
|
||||
{
|
||||
/* add command bound to key (if found) */
|
||||
ptr_key = gui_key_search (gui_keys[GUI_KEY_CONTEXT_DEFAULT],
|
||||
ptr_key_name);
|
||||
if (ptr_key)
|
||||
{
|
||||
gui_input_insert_string (gui_current_window->buffer, " ");
|
||||
gui_input_insert_string (gui_current_window->buffer,
|
||||
ptr_key->command);
|
||||
}
|
||||
gui_input_insert_string (gui_current_window->buffer, " ");
|
||||
gui_input_insert_string (
|
||||
gui_current_window->buffer,
|
||||
(ptr_key_raw) ?
|
||||
ptr_key_raw->command : ptr_key->command);
|
||||
}
|
||||
gui_input_text_changed_modifier_and_signal (
|
||||
gui_current_window->buffer,
|
||||
|
||||
+1
-2
@@ -90,8 +90,7 @@ extern time_t gui_key_last_activity_time;
|
||||
|
||||
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 void gui_key_grab_init (int grab_command, const char *delay);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user