The mouse interface

The low-level mouse interface: Optionally!

// File: mouse.w_js (JScript)

function WM_MOUSE(id,x,y,key)
{
   var id = "id: " + id + "             "
   var x = "X: " + x + "             "
   var y = "Y: " + y + "             "
   var key = "Key: " + key + "             "

   Window.Delete(0);
   Window.TextOut(0,50,10,id);
   Window.TextOut(0,50,30,x);
   Window.TextOut(0,50,50,y);
   Window.TextOut(0,50,70,key);
   Window.UpdateWindow()
}
' VBScript
Function WM_MOUSE(id,x,y,key)
   id = "id: " & id & "             "
   x = "X: " & x & "             "
   y = "Y: " & y & "             "
   key = "Key: " & key & "             "

   Window.Delete(0)
   Window.TextOut 0,50,10,id
   Window.TextOut 0,50,30,x
   Window.TextOut 0,50,50,y
   Window.TextOut 0,50,70,key
   Window.UpdateWindow()
End Function
Notes:
  1. id:
    WM_RBUTTONDOWN: 0x0204 
    WM_LBUTTONDBLCLK: 0x0203 
    WM_RBUTTONDBLCLK: 0x0206 
    WM_LBUTTONDOWN: 0x0201 
    
  2. key (mask):
    MK_CONTROL 0x0008 Set if the CTRL key is down.
    MK_LBUTTON 0x0001 Set if the left mouse button is down.
    MK_MBUTTON 0x0010 Set if the middle mouse button is down.
    MK_RBUTTON 0x0002 Set if the right mouse button is down.
    MK_SHIFT 0x0004 Set if the SHIFT key is down.
    
content
The new script host. It is not wscript.exe
JScript and VBScript are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.