mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 08:45:43 +02:00
core: also display mouse codes with /debug key
This commit is contained in:
@@ -7804,8 +7804,8 @@ command_init ()
|
||||
" hdata: display infos about hdata (with free: remove all hdata "
|
||||
"in memory)\n"
|
||||
"infolists: display infos about infolists\n"
|
||||
" key: enable keyboard debug: display raw codes, expanded "
|
||||
"key name and associated command ('q' to quit this mode)\n"
|
||||
" key: enable keyboard and mouse debug: display raw codes, "
|
||||
"expanded key name and associated command ('q' to quit this mode)\n"
|
||||
" libs: display infos about external libraries used\n"
|
||||
" memory: display infos about memory usage\n"
|
||||
" mouse: toggle debug for mouse\n"
|
||||
|
||||
@@ -458,7 +458,7 @@ gui_key_flush (int paste)
|
||||
length_key_str = strlen (key_str);
|
||||
|
||||
/* set last key used in buffer if combo buffer is empty */
|
||||
if (gui_key_grab || gui_mouse_event_pending || !gui_key_combo_buffer[0])
|
||||
if (gui_key_grab || gui_mouse_event_pending || !gui_key_combo[0])
|
||||
last_key_used = i;
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ gui_key_flush (int paste)
|
||||
gui_key_buffer_remove (0, last_key_used + 1);
|
||||
|
||||
if (!gui_key_grab && !gui_mouse_event_pending)
|
||||
gui_key_combo_buffer[0] = '\0';
|
||||
gui_key_combo[0] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -436,6 +436,9 @@ gui_mouse_event_end ()
|
||||
const char *mouse_key;
|
||||
int bare_event;
|
||||
|
||||
if (gui_key_debug)
|
||||
gui_key_debug_print_key (gui_key_combo, NULL, NULL, NULL, 1);
|
||||
|
||||
gui_mouse_event_pending = 0;
|
||||
|
||||
/* end mouse event timer */
|
||||
@@ -446,7 +449,7 @@ gui_mouse_event_end ()
|
||||
}
|
||||
|
||||
/* get key from mouse code */
|
||||
mouse_key = gui_mouse_event_code2key (gui_key_combo_buffer);
|
||||
mouse_key = gui_mouse_event_code2key (gui_key_combo);
|
||||
if (mouse_key && mouse_key[0])
|
||||
{
|
||||
bare_event = string_match (mouse_key, "*-event-*", 1);
|
||||
@@ -455,7 +458,7 @@ gui_mouse_event_end ()
|
||||
if (!bare_event)
|
||||
gui_mouse_grab_end (mouse_key);
|
||||
}
|
||||
else
|
||||
else if (!gui_key_debug)
|
||||
{
|
||||
/* execute command (if found) */
|
||||
(void) gui_key_focus (mouse_key,
|
||||
@@ -465,5 +468,5 @@ gui_mouse_event_end ()
|
||||
gui_mouse_event_reset ();
|
||||
}
|
||||
|
||||
gui_key_combo_buffer[0] = '\0';
|
||||
gui_key_combo[0] = '\0';
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ gui_bar_item_input_text_cb (const void *pointer, void *data,
|
||||
{
|
||||
snprintf (str_key_debug, sizeof (str_key_debug),
|
||||
"%s%s",
|
||||
_("keyboard debug ('q' to quit debug mode)"),
|
||||
_("keyboard and mouse debug ('q' to quit debug mode)"),
|
||||
str_cursor);
|
||||
return strdup (str_key_debug);
|
||||
}
|
||||
|
||||
+94
-76
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -77,7 +77,7 @@ extern int gui_default_keys_count[GUI_KEY_NUM_CONTEXTS];
|
||||
extern char *gui_key_context_string[GUI_KEY_NUM_CONTEXTS];
|
||||
extern int gui_key_debug;
|
||||
extern int gui_key_verbose;
|
||||
extern char gui_key_combo_buffer[];
|
||||
extern char gui_key_combo[];
|
||||
extern int gui_key_grab;
|
||||
extern int gui_key_grab_count;
|
||||
extern int *gui_key_buffer;
|
||||
@@ -112,6 +112,9 @@ extern int gui_key_unbind (struct t_gui_buffer *buffer, int context,
|
||||
const char *key);
|
||||
extern int gui_key_unbind_plugin (const char *context, const char *key);
|
||||
extern int gui_key_focus (const char *key, int context);
|
||||
extern void gui_key_debug_print_key (const char *combo, const char *key_name,
|
||||
const char *key_name_alias,
|
||||
const char *command, int mouse);
|
||||
extern int gui_key_pressed (const char *key_str);
|
||||
extern void gui_key_free (int context,
|
||||
struct t_gui_key **keys,
|
||||
|
||||
Reference in New Issue
Block a user