From WikiChip
Difference between revisions of "mirc/identifiers/$mouse"
< mirc‎ | identifiers

(Created page with "{{mirc title|$mouse Identifier}}'''$mouse''' returns informations about the mouse and its buttons == Synopsis == <pre>$mouse</pre> == Paramters == None == Properties == Th...")
 
(Properties)
Line 9: Line 9:
  
 
== Properties ==
 
== Properties ==
This identifier uniquely takes no parameter but has properties, it is not possible to use such syntax for custom identifier, $myalias.prop would just call the alias named "$myalias.prop"
+
This identifier almost uniquely takes no parameter but has properties ({{mIRC|$insong}} and the like also have this}}, it is not possible to use such syntax for custom identifier, $myalias.prop would just call the alias named "$myalias.prop"
  
 
* '''.x and .y''' - returns the position of the mouse relative to the active window
 
* '''.x and .y''' - returns the position of the mouse relative to the active window
Line 23: Line 23:
 
** if ($mouse.key & 8) echo alt 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 & 16) echo right mouse button is pressed.
 
  
 
== Example ==
 
== Example ==

Revision as of 20:00, 14 January 2018

$mouse returns informations about the mouse and its buttons


Synopsis

$mouse

Paramters

None

Properties

This identifier almost uniquely takes no parameter but has properties ($insong and the like also have this}}, it is not possible to use such syntax for custom identifier, $myalias.prop would just call the alias named "$myalias.prop"

  • .x and .y - returns the position of the mouse relative to the active window
  • .mx and .my - returns the position of the mouse relative to the main mIRC window
  • .dx and .dy - returns the position of the mouse relative to the desktop window
  • .cx and .cy - returns position relative to the primary monitor.
  • .win - returns the name of the active window
  • .lb - returns $true if a mouse event occured over a listbox, $false otherwise.
  • .key - Returns a bitmask, you can use the bitwise & operator to check for button/shift/alt/control state:
    • 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.

Example

//echo -a $mouse.x

Compatibility

Added: mIRC v5.3
Added on: 13 Dec 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also

$click