• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Mouse click?

Status
Not open for further replies.
Level 3
Joined
Feb 20, 2007
Messages
32
I went over the API's, but is there any way to get a mouse click event, or check if either side of the mosue is depressed?
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
With the next release, which is right around the corner, the MouseAPI will be upgraded with a two new natives:
JASS:
//===================================================
// Mouse API constants
//===================================================
globals
	constant integer 	EVENT_LMOUSEUP 			= 0
	constant integer 	EVENT_LMOUSEDOWN 		= 1
	constant integer 	EVENT_RMOUSEUP 			= 2
	constant integer 	EVENT_RMOUSEDOWN 		= 3
	constant integer 	EVENT_MMOUSEUP 			= 4
	constant integer 	EVENT_MMOUSEDOWN 		= 5
	constant integer 	EVENT_MOUSEWHEEL 		= 6
endglobals
native TriggerRegisterMouseEvent takes trigger whichTrigger, integer eventtype returns nothing
native GetTriggerWheelDelta takes nothing returns integer

If you use the EVENT_MOUSEWHEEL, you can use the GetTriggerWheelDelta afterwards, to see what way the wheel scrolled, it's positive if up, and negative if down.
 
Status
Not open for further replies.
Top