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