$mouse » History » Version 9
Per Amundsen, 02/23/2023 05:07 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$mouse* |
||
4 | |||
5 | Returns various properties about the mouse and keys pressed during [[Scripting_Events|events]]. |
||
6 | |||
7 | 9 | Per Amundsen | _See also [[$menu]], [[$menutype]], [[$menucontext]], [[$menuicon]], [[Scripting_Menus|Menus]]._ |
8 | 4 | Per Amundsen | |
9 | 1 | Per Amundsen | *Properties* |
10 | |||
11 | 8 | Per Amundsen | table(ktable). |
12 | |*Property*|*Description*| |
||
13 | | .lb | Returns [[$true]] if the mouse event occurred in a side-listbox otherwise [[$false]]. | |
||
14 | | .x | Mouse X position relative to active window. | |
||
15 | | .y | Mouse Y position relative to active window. | |
||
16 | | .mx | Mouse X position relative to AdiIRC main window. | |
||
17 | | .my | Mouse Y position relative to AdiIRC main window. | |
||
18 | | .dx | Mouse X position relative to the desktop area. | |
||
19 | | .dy | Mouse Y position relative to the desktop area. | |
||
20 | | .key | Bitwise flag, see example. | |
||
21 | | .cx | *TODO* | |
||
22 | | .cy | *TODO* | |
||
23 | | .win | Returns the name of the active window. | |
||
24 | 1 | Per Amundsen | |
25 | *Example* |
||
26 | |||
27 | <pre> |
||
28 | alias Example { |
||
29 | ; Test $mouse.key for various values, more than one value can be true. |
||
30 | if ($mouse.key & 1) echo left button is pressed. |
||
31 | if ($mouse.key & 2) echo control key is pressed. |
||
32 | if ($mouse.key & 4) echo shift key is pressed. |
||
33 | if ($mouse.key & 8) echo alt key is pressed. |
||
34 | if ($mouse.key & 16) echo right mouse button is pressed. |
||
35 | 6 | Per Amundsen | if ($mouse.key & 32) echo middle mouse button is pressed. (AdiIRC only) |
36 | if ($mouse.key & 64) echo x mouse button 1 is pressed. (AdiIRC only) |
||
37 | if ($mouse.key & 128) echo x mouse button 2 is pressed. (AdiIRC only) |
||
38 | 7 | Per Amundsen | if ($mouse.key & 256) echo alt+gr pressed. (AdiIRC only) |
39 | 1 | Per Amundsen | } |
40 | |||
41 | ; Print mouse X and Y coordinates. |
||
42 | //echo -ag $mouse.x / $mouse.y |
||
43 | </pre> |