Project

General

Profile

Mouse » History » Version 2

Per Amundsen, 02/16/2023 02:45 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
<pre>
20
None = 0
21
Mouse = 1
22
SIngleClick = 2
23
MiddleClick = 3
24
DoubleClick = 4
25
DoubleMiddleclick = 5
26
UpClick = 6
27
UpMiddleClick = 7
28
RightClick = 8
29
DoubleRightClick = 9
30
ListBoxClick = 10
31
Leave = 11
32
Drop = 12
33
WheelUp = 13
34
WheelDown = 14
35
Resize = 15
36
Minimize = 16
37
Maximize = 17
38
Restore = 18
39
</pre>
40
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>