GuiMouseEventCtrl
Used to overlaps a 'hot region' where you want to catch inputs with and have specific events occur based on individual callbacks.
Input
bool
Whether the control should lock the mouse between up and down button events.
Callbacks
void
onMouseDown(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is pressed down while in this control.
void
onMouseUp(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is released while in this control.
void
onMouseMove(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is moved (without dragging) while in this control.
void
onMouseDragged(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is dragged while in this control.
void
onMouseEnter(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse enters this control.
void
onMouseLeave(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse leaves this control.
void
onRightMouseDown(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the right mouse button is pressed while in this control.
void
onRightMouseUp(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the right mouse button is released while in this control.
void
onRightMouseDragged(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is dragged in this control while the right mouse button is pressed.
Detailed Description
Used to overlaps a 'hot region' where you want to catch inputs with and have specific events occur based on individual callbacks.
Mouse event callbacks supported by this control are: onMouseUp, onMouseDown, onMouseMove, onMouseDragged, onMouseEnter, onMouseLeave, onRightMouseDown, onRightMouseUp and onRightMouseDragged.
new GuiMouseEventCtrl() { lockMouse = "0"; //Properties not specific to this control have been omitted from this example. };
Input
bool lockMouse
Whether the control should lock the mouse between up and down button events.
Callbacks
onMouseDown(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is pressed down while in this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Mouse was pressed down in this control, causing the callback GuiMouseEventCtrl::onMouseDown(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onMouseUp(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is released while in this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Mouse was released in this control, causing the callback GuiMouseEventCtrl::onMouseUp(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onMouseMove(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is moved (without dragging) while in this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Mouse was moved in this control, causing the callback GuiMouseEventCtrl::onMouseMove(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onMouseDragged(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is dragged while in this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Mouse was dragged in this control, causing the callback GuiMouseEventCtrl::onMouseDragged(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onMouseEnter(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse enters this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Mouse entered this control, causing the callback GuiMouseEventCtrl::onMouseEnter(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onMouseLeave(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse leaves this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Mouse left this control, causing the callback GuiMouseEventCtrl::onMouseLeave(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onRightMouseDown(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the right mouse button is pressed while in this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Right mouse button was pressed in this control, causing the callback GuiMouseEventCtrl::onRightMouseDown(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onRightMouseUp(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the right mouse button is released while in this control.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Right mouse button was released in this control, causing the callback GuiMouseEventCtrl::onRightMouseUp(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }
onRightMouseDragged(int modifier, Point2I mousePoint, int mouseClickCount)
Callback that occurs whenever the mouse is dragged in this control while the right mouse button is pressed.
Parameters:
modifier | Key that was pressed during this callback. Values are: |
$EventModifier::SHIFT
$EventModifier::LCTRL
$EventModifier::RCTRL
$EventModifier::CTRL
$EventModifier::CTRL
$EventModifier::RALT
$EventModifier::ALT
Parameters:
mousePoint | X/Y location of the mouse point |
mouseClickCount | How many mouse clicks have occured for this event |
// Right mouse button was dragged in this control, causing the callback GuiMouseEventCtrl::onRightMouseDragged(%this,%modifier,%mousePoint,%mouseClickCount) { // Code to call when a mouse event occurs. }