1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: allow send of hsignal instead of command for keys in context "mouse"

This commit is contained in:
Sebastien Helleu
2011-08-09 14:56:15 +02:00
parent 40c5eb207d
commit fe9aee25a5
16 changed files with 98 additions and 40 deletions
+1
View File
@@ -364,6 +364,7 @@ For context "mouse" (possible in context "cursor" too), key has format: "@area:k
item(*): any bar item
item(xxx): bar item "xxx"
The key can start or end with '*' to match many mouse events.
A special value for command wit format "hsignal:name" can be used for context mouse, this will send the hsignal "name" with the focus hashtable as argument.
Examples:
key alt-x to toggle nicklist bar:
+1
View File
@@ -364,6 +364,7 @@ For context "mouse" (possible in context "cursor" too), key has format: "@area:k
item(*): any bar item
item(xxx): bar item "xxx"
The key can start or end with '*' to match many mouse events.
A special value for command wit format "hsignal:name" can be used for context mouse, this will send the hsignal "name" with the focus hashtable as argument.
Examples:
key alt-x to toggle nicklist bar:
+1
View File
@@ -364,6 +364,7 @@ Pour le contexte "mouse" (possible aussi pour le contexte "cursor"), la touche a
item(*): n'importe quel objet de barre
item(xxx): l'objet de barre "xxx"
La touche peut commencer ou se terminer par '*' pour plusieurs évènements de la souris.
Une valeur spéciale pour la commande avec le format "hsignal:nom" peut être utilisée dans le contexte "mouse", cela enverra le signal "nom" avec la hashtable du focus comme paramètre.
Exemples:
touche alt-x pour activer/désactiver la liste des pseudos:
+1
View File
@@ -364,6 +364,7 @@ For context "mouse" (possible in context "cursor" too), key has format: "@area:k
item(*): any bar item
item(xxx): bar item "xxx"
The key can start or end with '*' to match many mouse events.
A special value for command wit format "hsignal:name" can be used for context mouse, this will send the hsignal "name" with the focus hashtable as argument.
Examples:
key alt-x to toggle nicklist bar:
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-07-05 15:37+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1469,6 +1469,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-07-14 20:53+0100\n"
"Last-Translator: Nils Görs\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1520,6 +1520,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-07-05 15:37+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1479,6 +1479,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+8 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"PO-Revision-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-08-09 12:40+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1510,6 +1510,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
@@ -1560,6 +1563,9 @@ msgstr ""
" item(xxx): l'objet de barre \"xxx\"\n"
"La touche peut commencer ou se terminer par '*' pour plusieurs évènements de "
"la souris.\n"
"Une valeur spéciale pour la commande avec le format \"hsignal:nom\" peut "
"être utilisée dans le contexte \"mouse\", cela enverra le signal \"nom\" "
"avec la hashtable du focus comme paramètre.\n"
"\n"
"Exemples:\n"
" touche alt-x pour activer/désactiver la liste des pseudos:\n"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1305,6 +1305,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-07-16 11:32+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1485,6 +1485,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-07-05 15:38+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1483,6 +1483,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1476,6 +1476,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1313,6 +1313,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-08-08 16:53+0200\n"
"POT-Creation-Date: 2011-08-09 12:39+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1157,6 +1157,9 @@ msgid ""
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse events.\n"
"A special value for command wit format \"hsignal:name\" can be used for "
"context mouse, this will send the hsignal \"name\" with the focus hashtable "
"as argument.\n"
"\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
+4 -1
View File
@@ -5677,7 +5677,10 @@ command_init ()
" item(*): any bar item\n"
" item(xxx): bar item \"xxx\"\n"
"The key can start or end with '*' to match many mouse "
"events.\n\n"
"events.\n"
"A special value for command wit format \"hsignal:name\" "
"can be used for context mouse, this will send the hsignal "
"\"name\" with the focus hashtable as argument.\n\n"
"Examples:\n"
" key alt-x to toggle nicklist bar:\n"
" /key bind meta-x /bar toggle nicklist\n"
+46 -28
View File
@@ -739,10 +739,13 @@ gui_key_focus_command (const char *key, int context,
struct t_gui_focus_info *focus_info2)
{
struct t_gui_key *ptr_key;
int i, errors, matching, area_type;
int i, errors, matching, area_type, debug;
char *pos, *command, **commands, *area_name;
struct t_hashtable *hashtable;
debug = ((gui_cursor_debug && (context == GUI_KEY_CONTEXT_CURSOR))
|| (gui_mouse_debug && (context == GUI_KEY_CONTEXT_MOUSE)));
for (ptr_key = gui_keys[context]; ptr_key;
ptr_key = ptr_key->next_key)
{
@@ -771,49 +774,64 @@ gui_key_focus_command (const char *key, int context,
hashtable = hook_focus_get_data (focus_info1,
focus_info2,
key);
if (gui_cursor_debug || gui_mouse_debug)
if (debug)
{
gui_chat_printf (NULL, "Hashtable focus: %s",
hashtable_get_string (hashtable,
"keys_values_sorted"));
}
command = string_replace_with_hashtable (ptr_key->command,
hashtable,
&errors);
if (command)
if (string_strncasecmp (ptr_key->command, "hsignal:", 8) == 0)
{
if (errors == 0)
if (ptr_key->command[8])
{
if (gui_cursor_debug || gui_mouse_debug)
if (debug)
{
gui_chat_printf (NULL,
"Command executed: %s (%s)",
command, ptr_key->command);
gui_chat_printf (NULL, "Sending hsignal \"%s\"",
ptr_key->command + 8);
}
if ((context == GUI_KEY_CONTEXT_CURSOR) && gui_cursor_debug)
hook_hsignal_send (ptr_key->command + 8, hashtable);
}
}
else
{
command = string_replace_with_hashtable (ptr_key->command,
hashtable,
&errors);
if (command)
{
if (errors == 0)
{
gui_input_delete_line (gui_current_window->buffer);
}
commands = string_split_command (command, ';');
if (commands)
{
for (i = 0; commands[i]; i++)
if (debug)
{
input_data (gui_current_window->buffer, commands[i]);
gui_chat_printf (NULL,
"Executing command: %s (%s)",
command, ptr_key->command);
}
if ((context == GUI_KEY_CONTEXT_CURSOR) && gui_cursor_debug)
{
gui_input_delete_line (gui_current_window->buffer);
}
commands = string_split_command (command, ';');
if (commands)
{
for (i = 0; commands[i]; i++)
{
input_data (gui_current_window->buffer, commands[i]);
}
string_free_split_command (commands);
}
string_free_split_command (commands);
}
}
else
{
if (gui_cursor_debug || gui_mouse_debug)
else
{
gui_chat_printf (NULL,
"Command NOT executed (%s)",
ptr_key->command);
if (debug)
{
gui_chat_printf (NULL,
"Command NOT executed (%s)",
ptr_key->command);
}
}
free (command);
}
free (command);
}
if (hashtable)
hashtable_free (hashtable);