Project

General

Profile

Mouse » History » Version 3

Per Amundsen, 02/16/2023 02:48 PM

1 1 Per Amundsen
_Added in 4.3_
2
3
*/mouse <@window> <event> <mouse.x> <mouse.y> <mouse.key>*
4
5
Triggers a [[Scripting_Menus#Mouse-events|Mouse Event]] with the specified parameters.
6
7
*Parameters*
8
9 2 Per Amundsen
table(ktable).
10
|*Parameter*|*Description*|
11
| @window | The window to trigger the mouse event for. |
12
| event | The [[Scripting_Menus#Mouse-events<notextile>|</notextile>Mouse Event]] to trigger. |
13
| mouse.x | The [[$mouse]].x coordinates to trigger at. |
14
| mouse.y | The [[$mouse]].y coordinates to trigger at. |
15
| mouse.key | The [[$mouse]].key flag to trigger with. |
16 1 Per Amundsen
17
*Events*
18
19 3 Per Amundsen
table(ktable).
20
|*Event*|*Value*|
21
| None | 0 |
22
| Mouse | 1 |
23
| SIngleClick | 2 |
24
| MiddleClick | 3 |
25
| DoubleClick | 4 |
26
| DoubleMiddleclick | 5 |
27
| UpClick | 6 |
28
| UpMiddleClick | 7 |
29
| RightClick | 8 |
30
| DoubleRightClick | 9 |
31
| ListBoxClick | 10 |
32
| Leave | 11 |
33
| Drop | 12 |
34
| WheelUp | 13 |
35
| WheelDown | 14 |
36
| Resize | 15 |
37
| Minimize | 16 |
38
| Maximize | 17 |
39
| Restore | 18 |
40 1 Per Amundsen
41
*Example*
42
43
<pre>
44
; Create a mouse event for '@window'.
45
menu @window {
46
  mouse:{
47
    echo -ag mouse.x is $mouse.x mouse.y is $mouse.y mouse.key is $mouse.key
48
  }
49
}
50
51
alias testmouse {
52
  ; Create a custom window named '@window'.
53
  /window @window
54
55
  ; Call the mouse event for '@window'.
56
  /mouse @window 1 42 42 0
57
}
58
</pre>