$mouse » History » Version 5
Per Amundsen, 03/26/2020 02:26 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 | 3 | Per Amundsen | if ($mouse.key & 32) echo middle mouse button is pressed. |
34 | if ($mouse.key & 64) echo x mouse button 1 is pressed. |
||
35 | if ($mouse.key & 128) echo x mouse button 2 is pressed. |
||
36 | 1 | Per Amundsen | } |
37 | |||
38 | ; Print mouse X and Y coordinates. |
||
39 | //echo -ag $mouse.x / $mouse.y |
||
40 | </pre> |