MouseEvent
Table of contents
Represent a mouse event
type MouseEvent struct {
AltKey bool
Button int
Buttons int
ClientX float64
ClientY float64
CtrlKey bool
MetaKey bool
ScreenX float64
ScreenY float64
ShiftKey bool
TimeStamp uint64
}
Member | Type | Description |
---|---|---|
AltKey | bool |
true if the alt key was down when the event was fired, false otherwise |
Button | int |
Indicates which button was pressed on the mouse to trigger the event: PrimaryMouseButton /0 , AuxiliaryMouseButton /1 , SecondaryMouseButton /2 , MouseButton4 /3 and MouseButton5 /4 |
Buttons | int |
Indicate which buttons are pressed on the mouse (or other input device) when a mouse event is triggered. Each button that can be pressed is represented by a given mask: PrimaryMouseMask /1 , SecondaryMouseMask /2 , AuxiliaryMouseMask /4 , MouseMask4 /8 and MouseMask5 /16 |
ClientX | float64 |
Horizontal coordinate within the application's viewport at which the event occurred |
ClientY | float64 |
Vertical coordinate within the application's viewport at which the event occurred |
CtrlKey | bool |
true if the control key was down when the event was fired, false otherwise |
MetaKey | bool |
true if the meta key was down when the event was fired, false otherwise |
ScreenX | float64 |
Horizontal coordinate (offset) of the mouse pointer in global (screen) coordinates |
ScreenY | float64 |
Vertical coordinate (offset) of the mouse pointer in global (screen) coordinates |
ShiftKey | bool |
true if the shift key was down when the event was fired, false otherwise |
TimeStamp | uint64 |
Time at which the event was created (in milliseconds). This value is time since epoch—but in reality, browsers' definitions vary |
Global related functions
func GetClickListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "click-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetContextMenuListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "context-menu" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetDoubleClickListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "double-click-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetMouseDownListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "mouse-down" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetMouseMoveListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "mouse-move" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetMouseOutListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "mouse-out" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetMouseOverListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "mouse-over" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned
func GetMouseUpListeners(view View, subviewID ...string) []func(View, MouseEvent)
Returns the "mouse-up" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned