Project

General

Profile

Mouse » History » Revision 2

Revision 1 (Per Amundsen, 10/24/2022 01:00 PM) → Revision 2/3 (Per Amundsen, 02/16/2023 02:45 PM)

_Added in 4.3_ 

 */mouse <@window> <event> <mouse.x> <mouse.y> <mouse.key>* 

 Triggers a [[Scripting_Menus#Mouse-events|Mouse Event]] with the specified parameters. 

 *Parameters* 

 table(ktable). 
 |*Parameter*|*Description*| 
 | @window | - The window to trigger the mouse event for. | 
 | event | - The [[Scripting_Menus#Mouse-events<notextile>|</notextile>Mouse [[Scripting_Menus#Mouse-events|Mouse Event]] to trigger. | 
 | mouse.x | - The [[$mouse]].x coordinates to trigger at. | 
 | mouse.y | - The [[$mouse]].y coordinates to trigger at. | 
 | mouse.key | - The [[$mouse]].key flag to trigger with. | 

 *Events* 

 <pre> 
 None = 0 
 Mouse = 1 
 SIngleClick = 2 
 MiddleClick = 3 
 DoubleClick = 4 
 DoubleMiddleclick = 5 
 UpClick = 6 
 UpMiddleClick = 7 
 RightClick = 8 
 DoubleRightClick = 9 
 ListBoxClick = 10 
 Leave = 11 
 Drop = 12 
 WheelUp = 13 
 WheelDown = 14 
 Resize = 15 
 Minimize = 16 
 Maximize = 17 
 Restore = 18 
 </pre> 

 *Example* 

 <pre> 
 ; Create a mouse event for '@window'. 
 menu @window { 
   mouse:{ 
     echo -ag mouse.x is $mouse.x mouse.y is $mouse.y mouse.key is $mouse.key 
   } 
 } 

 alias testmouse { 
   ; Create a custom window named '@window'. 
   /window @window 

   ; Call the mouse event for '@window'. 
   /mouse @window 1 42 42 0 
 } 
 </pre>