Mouse Button tracking in Tutorials & Snippets
|
|
Quick and easy tracking of which of the three mouse buttons are being held down.
This can alternatively downloaded as a library here.
#define MOUSE_LEFT 1 #define MOUSE_RIGHT 2 #define MOUSE_MIDDLE 4
client var mouses_down = 0
MouseDown(atom/object,location,control,params) var/list/pref = params2list(params) if("left" in pref) mouses_down |= MOUSE_LEFT if("right" in pref) mouses_down |= MOUSE_RIGHT if("middle" in pref) mouses_down |= MOUSE_MIDDLE
..()
MouseUp(object,location,control,params) var/list/pref = params2list(params) if("left" in pref) mouses_down &= ~MOUSE_LEFT if("right" in pref) mouses_down &= ~MOUSE_RIGHT if("middle" in pref) mouses_down &= ~MOUSE_MIDDLE
..()
|
|