core: add incomplete mouse events "event-down" and "event-drag" (task #11840)
This commit is contained in:
parent
4d436e3ac6
commit
8b52fc90d5
@ -7,6 +7,7 @@ v0.4.0-dev, 2012-11-02
|
||||
Version 0.4.0 (under dev!)
|
||||
--------------------------
|
||||
|
||||
* core: add incomplete mouse events "event-down" and "event-drag" (task #11840)
|
||||
* core: add command /eval, use expression in conditions for bars
|
||||
* core: add option "-quit" for command /upgrade (save session and quit without
|
||||
restarting WeeChat, for delayed restoration)
|
||||
|
@ -1101,15 +1101,25 @@ Liste der Mausgesten (nur für Maustasten, nicht für das Mausrad, anwendbar):
|
||||
|
||||
[width="50%",cols="3m,4",options="header"]
|
||||
|========================================
|
||||
| Mausgeste | Distanz
|
||||
| Bewegung hoch | 3 ... 19
|
||||
| Bewegung hoch (lang) | ≥ 20
|
||||
| Bewegung runter | 3 ... 19
|
||||
| Bewegung runter (lang) | ≥ 20
|
||||
| Bewegung links | 3 ... 39
|
||||
| Bewegung links (lang) | ≥ 40
|
||||
| Bewegung rechts | 3 ... 39
|
||||
| Bewegung rechts (lang) | ≥ 40
|
||||
| Mausgeste | Distanz
|
||||
| gesture-up | 3 ... 19
|
||||
| gesture-up-long | ≥ 20
|
||||
| gesture-down | 3 ... 19
|
||||
| gesture-down-long | ≥ 20
|
||||
| gesture-left | 3 ... 39
|
||||
| gesture-left-long | ≥ 40
|
||||
| gesture-right | 3 ... 39
|
||||
| gesture-right-long | ≥ 40
|
||||
|========================================
|
||||
|
||||
// TRANSLATION MISSING
|
||||
List of incomplete events (only for buttons, useful for plugins/scripts):
|
||||
|
||||
[width="50%",cols="3m,4",options="header"]
|
||||
|========================================
|
||||
| Event | Description
|
||||
| event-down | button was pressed but not released yet
|
||||
| event-drag | mouse was moved with button pressed down
|
||||
|========================================
|
||||
|
||||
Bespiele von Ereignissen:
|
||||
@ -1117,6 +1127,8 @@ Bespiele von Ereignissen:
|
||||
* `button1`
|
||||
* `ctrl-button1`
|
||||
* `button1-gesture-right`
|
||||
* `button1-event-down`
|
||||
* `button1-event-drag`
|
||||
* `alt-button2-gesture-down-long`
|
||||
* `wheelup`
|
||||
* `ctrl-alt-wheeldown`
|
||||
|
@ -1103,11 +1103,22 @@ List of gestures (only for buttons, not wheel):
|
||||
| gesture-right-long | ≥ 40
|
||||
|========================================
|
||||
|
||||
List of incomplete events (only for buttons, useful for plugins/scripts):
|
||||
|
||||
[width="50%",cols="3m,4",options="header"]
|
||||
|========================================
|
||||
| Event | Description
|
||||
| event-down | button was pressed but not released yet
|
||||
| event-drag | mouse was moved with button pressed down
|
||||
|========================================
|
||||
|
||||
Example of events:
|
||||
|
||||
* `button1`
|
||||
* `ctrl-button1`
|
||||
* `button1-gesture-right`
|
||||
* `button1-event-down`
|
||||
* `button1-event-drag`
|
||||
* `alt-button2-gesture-down-long`
|
||||
* `wheelup`
|
||||
* `ctrl-alt-wheeldown`
|
||||
|
@ -1133,11 +1133,23 @@ Liste des gestes (seulement pour les boutons, pas la roulette) :
|
||||
| gesture-right-long | ≥ 40
|
||||
|========================================
|
||||
|
||||
Exemple d'évènements :
|
||||
Liste des évènements incomplets (seulement pour les boutons, pratique pour les
|
||||
extensions/scripts) :
|
||||
|
||||
[width="50%",cols="3m,4",options="header"]
|
||||
|========================================
|
||||
| Evènement | Description
|
||||
| event-down | le bouton a été pressé mais pas encore relâché
|
||||
| event-drag | la souris a bougé avec le bouton pressé
|
||||
|========================================
|
||||
|
||||
Exemples d'évènements :
|
||||
|
||||
* `button1`
|
||||
* `ctrl-button1`
|
||||
* `button1-gesture-right`
|
||||
* `button1-event-down`
|
||||
* `button1-event-drag`
|
||||
* `alt-button2-gesture-down-long`
|
||||
* `wheelup`
|
||||
* `ctrl-alt-wheeldown`
|
||||
|
@ -1126,11 +1126,23 @@ Elenco di azioni (solo per i pulsanti, non la rotellina):
|
||||
| gesture-right-long | ≥ 40
|
||||
|========================================
|
||||
|
||||
// TRANSLATION MISSING
|
||||
List of incomplete events (only for buttons, useful for plugins/scripts):
|
||||
|
||||
[width="50%",cols="3m,4",options="header"]
|
||||
|========================================
|
||||
| Event | Description
|
||||
| event-down | button was pressed but not released yet
|
||||
| event-drag | mouse was moved with button pressed down
|
||||
|========================================
|
||||
|
||||
Esempio di eventi:
|
||||
|
||||
* `button1`
|
||||
* `ctrl-button1`
|
||||
* `button1-gesture-right`
|
||||
* `button1-event-down`
|
||||
* `button1-event-drag`
|
||||
* `alt-button2-gesture-down-long`
|
||||
* `wheelup`
|
||||
* `ctrl-alt-wheeldown`
|
||||
|
@ -1074,11 +1074,23 @@ WeeChat はデフォルトマウスイベントの多くを定義しています
|
||||
| gesture-right-long | ≥ 40
|
||||
|========================================
|
||||
|
||||
// TRANSLATION MISSING
|
||||
List of incomplete events (only for buttons, useful for plugins/scripts):
|
||||
|
||||
[width="50%",cols="3m,4",options="header"]
|
||||
|========================================
|
||||
| Event | Description
|
||||
| event-down | button was pressed but not released yet
|
||||
| event-drag | mouse was moved with button pressed down
|
||||
|========================================
|
||||
|
||||
イベントの表記例:
|
||||
|
||||
* `button1`
|
||||
* `ctrl-button1`
|
||||
* `button1-gesture-right`
|
||||
* `button1-event-down`
|
||||
* `button1-event-drag`
|
||||
* `alt-button2-gesture-down-long`
|
||||
* `wheelup`
|
||||
* `ctrl-alt-wheeldown`
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "../../core/weechat.h"
|
||||
#include "../../core/wee-config.h"
|
||||
#include "../../core/wee-hook.h"
|
||||
#include "../../core/wee-string.h"
|
||||
#include "../../core/wee-utf8.h"
|
||||
#include "../../plugins/plugin.h"
|
||||
#include "../gui-bar.h"
|
||||
@ -314,9 +315,6 @@ gui_mouse_event_code2key (const char *code)
|
||||
}
|
||||
}
|
||||
|
||||
if (!MOUSE_CODE_END(code[0]))
|
||||
return NULL;
|
||||
|
||||
/* add name of button event */
|
||||
for (i = 0; gui_mouse_button_codes[i][0]; i++)
|
||||
{
|
||||
@ -327,6 +325,21 @@ gui_mouse_event_code2key (const char *code)
|
||||
}
|
||||
}
|
||||
|
||||
if (!MOUSE_CODE_END(code[0]))
|
||||
{
|
||||
strcat (key, "-event-");
|
||||
if (MOUSE_CODE_MOTION(code[0])) {
|
||||
strcat (key, "drag");
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_mouse_event_x[1] = gui_mouse_event_x[0];
|
||||
gui_mouse_event_y[1] = gui_mouse_event_y[0];
|
||||
strcat (key, "down");
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mouse gesture: if (x,y) on release is different from (x,y) on click,
|
||||
* compute distance and angle between 2 points.
|
||||
@ -412,6 +425,7 @@ void
|
||||
gui_mouse_event_end ()
|
||||
{
|
||||
const char *mouse_key;
|
||||
int bare_event;
|
||||
|
||||
gui_mouse_event_pending = 0;
|
||||
|
||||
@ -426,9 +440,11 @@ gui_mouse_event_end ()
|
||||
mouse_key = gui_mouse_event_code2key (gui_key_combo_buffer);
|
||||
if (mouse_key && mouse_key[0])
|
||||
{
|
||||
bare_event = string_match (mouse_key, "*-event-*", 1);
|
||||
if (gui_mouse_grab)
|
||||
{
|
||||
gui_mouse_grab_end (mouse_key);
|
||||
if (!bare_event)
|
||||
gui_mouse_grab_end (mouse_key);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -436,7 +452,8 @@ gui_mouse_event_end ()
|
||||
(void) gui_key_focus (mouse_key,
|
||||
GUI_KEY_CONTEXT_MOUSE);
|
||||
}
|
||||
gui_mouse_event_reset ();
|
||||
if (!bare_event)
|
||||
gui_mouse_event_reset ();
|
||||
}
|
||||
|
||||
gui_key_combo_buffer[0] = '\0';
|
||||
|
@ -1009,6 +1009,11 @@ gui_key_focus_command (const char *key, int context,
|
||||
if (gui_key_cmp (key, ptr_key->area_key, context) != 0)
|
||||
continue;
|
||||
|
||||
/* ignore mouse event if not explicit requested */
|
||||
if ((context == GUI_KEY_CONTEXT_MOUSE) &&
|
||||
(string_match (key, "*-event-*", 1) != string_match (ptr_key->area_key, "*-event-*", 1)))
|
||||
continue;
|
||||
|
||||
/* check if focus is matching with key */
|
||||
matching = gui_key_focus_matching (ptr_key, hashtable_focus);
|
||||
if (!matching)
|
||||
|
Loading…
x
Reference in New Issue
Block a user