Project

General

Profile

$mouse » History » Version 3

Per Amundsen, 02/03/2017 02:47 PM

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
*Properties*
8
9 2 Per Amundsen
.lb - Returns [[$true]] if the mouse event occurred in a side-listbox otherwise [[$false]].
10 1 Per Amundsen
.x - Mouse X position relative to active window.
11
.y - Mouse Y position relative to active window.
12
.mx - Mouse X position relative to AdiIRC main window.
13
.my - Mouse Y position relative to AdiIRC main window.
14
.dx - Mouse X position relative to the desktop area.
15
.dy - Mouse Y position relative to the desktop area.
16
.key - Bitwise flag, see example.
17
18
*Example*
19
20
<pre>
21
alias Example {
22
  ; Test $mouse.key for various values, more than one value can be true.
23
  if ($mouse.key & 1) echo left button is pressed.
24
  if ($mouse.key & 2) echo control key is pressed.
25
  if ($mouse.key & 4) echo shift key is pressed.
26
  if ($mouse.key & 8) echo alt key is pressed.
27
  if ($mouse.key & 16) echo right mouse button is pressed.
28 3 Per Amundsen
  if ($mouse.key & 32) echo middle mouse button is pressed.
29
  if ($mouse.key & 64) echo x mouse button 1 is pressed.
30
  if ($mouse.key & 128) echo x mouse button 2 is pressed.
31 1 Per Amundsen
}
32
33
; Print mouse X and Y coordinates.
34
//echo -ag $mouse.x / $mouse.y
35
</pre>