$mouse » History » Version 4
  Per Amundsen, 12/31/2018 11:40 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 | |||
| 20 | *Example*  | 
||
| 21 | |||
| 22 | <pre>  | 
||
| 23 | alias Example { | 
||
| 24 | ; Test $mouse.key for various values, more than one value can be true.  | 
||
| 25 | if ($mouse.key & 1) echo left button is pressed.  | 
||
| 26 | if ($mouse.key & 2) echo control key is pressed.  | 
||
| 27 | if ($mouse.key & 4) echo shift key is pressed.  | 
||
| 28 | if ($mouse.key & 8) echo alt key is pressed.  | 
||
| 29 | if ($mouse.key & 16) echo right mouse button is pressed.  | 
||
| 30 | 3 | Per Amundsen | if ($mouse.key & 32) echo middle mouse button is pressed.  | 
| 31 | if ($mouse.key & 64) echo x mouse button 1 is pressed.  | 
||
| 32 | if ($mouse.key & 128) echo x mouse button 2 is pressed.  | 
||
| 33 | 1 | Per Amundsen | }  | 
| 34 | |||
| 35 | ; Print mouse X and Y coordinates.  | 
||
| 36 | //echo -ag $mouse.x / $mouse.y  | 
||
| 37 | </pre>  |