$mouse » History » Revision 7
Revision 6 (Per Amundsen, 03/26/2020 02:35 AM) → Revision 7/9 (Per Amundsen, 01/30/2022 11:45 AM)
_Added in 1.9.0_
*$mouse*
Returns various properties about the mouse and keys pressed during [[Scripting_Events|events]].
_See also [[$menutype]], [[$menu]], [[$menucontext]], [[Scripting_Menus|Menus]]._
*Properties*
.lb - Returns [[$true]] if the mouse event occurred in a side-listbox otherwise [[$false]].
.x - Mouse X position relative to active window.
.y - Mouse Y position relative to active window.
.mx - Mouse X position relative to AdiIRC main window.
.my - Mouse Y position relative to AdiIRC main window.
.dx - Mouse X position relative to the desktop area.
.dy - Mouse Y position relative to the desktop area.
.key - Bitwise flag, see example.
.cx - *TODO*
.cy - *TODO*
.win - Returns the name of the active window.
*Example*
<pre>
alias Example {
; Test $mouse.key for various values, more than one value can be true.
if ($mouse.key & 1) echo left button is pressed.
if ($mouse.key & 2) echo control key is pressed.
if ($mouse.key & 4) echo shift key is pressed.
if ($mouse.key & 8) echo alt key is pressed.
if ($mouse.key & 16) echo right mouse button is pressed.
if ($mouse.key & 32) echo middle mouse button is pressed. (AdiIRC only)
if ($mouse.key & 64) echo x mouse button 1 is pressed. (AdiIRC only)
if ($mouse.key & 128) echo x mouse button 2 is pressed. (AdiIRC only)
if ($mouse.key & 256) echo alt+gr pressed. (AdiIRC only)
}
; Print mouse X and Y coordinates.
//echo -ag $mouse.x / $mouse.y
</pre>