A UI Event represents a click or keypress. An event object is always provided with any onmousedown/onmouseup/onkeydown etc.
Public Member Functions | |
UIEvent (int x, int y, bool down) | |
Creates a new UI event for the mouse. More... | |
UIEvent (int key, char ch, bool down) | |
Creates a new UI event for a keypress. More... | |
void | stopPropagation () |
Stops the event bubbling to any other elements. More... | |
Public Attributes | |
int | clientX |
The x location of the mouse, as measured from the left of the screen. More... | |
int | clientY |
The y location of the mouse, as measured from the top of the screen. More... | |
int | keyCode |
The keycode of the key pressed. More... | |
bool | heldDown |
True if the mouse button or key is currently down. More... | |
Element | target |
The element that was clicked on or focused. More... | |
char | character |
The character that has been typed. More... | |
int | bubbleCount |
A counter that tracks how many times this event has bubbled so far. More... | |
Event | unityEvent |
The source Unity event. More... | |
bool | cancelBubble |
Set to true if you do not want this event to bubble any further. More... | |
Properties | |
KeyCode | unityKeyCode [get] |
Gets the keycode as a UnityEngine.KeyCode. More... | |
int | button [get] |
The mouse button that was pressed. See isLeftMouse and isRightMouse for clearer ways of using this value. More... | |
bool | leftMouseDown [get] |
Is the left mouse button currently down? More... | |
bool | rightMouseDown [get] |
Is the right mouse button currently down? More... | |
bool | isLeftMouse [get] |
Mouseup/down only. Was it the left mouse button? More... | |
bool | isRightMouse [get] |
Mouseup/down only. Was it the right mouse button? More... | |
bool | ctrlKey [get] |
Is a control key down? More... | |
bool | shiftKey [get] |
Is a shift key down? More... | |
bool | altKey [get] |
Is an alt key down? More... | |
Document | document [get] |
The document that this event has come from, if any. More... | |
WorldUI | worldUI [get] |
The WorldUI that this event has come from, if any. More... | |
float | relativeX [get] |
A 0-1 value of where this event occured relative to the target element. 0 is left edge, 1 is right edge. More... | |
float | relativeY [get] |
A 0-1 value of where this event occured relative to the target element. 0 is top edge, 1 is bottom edge. More... | |
int | localX [get] |
The position of the event relative to the top left corner of the target element in pixels. More... | |
int | localY [get] |
The position of the event relative to the top left corner of the target element in pixels. More... | |
|
inline |
Creates a new UI event for the mouse.
x | The x location of the mouse. |
y | The y location of the mouse. |
down | True if the button is held down. |
|
inline |
Creates a new UI event for a keypress.
key | The keycode. |
ch | The newly typed character. |
down | True if the key is held down. |
|
inline |
Stops the event bubbling to any other elements.
int PowerUI.UIEvent.bubbleCount |
A counter that tracks how many times this event has bubbled so far.
bool PowerUI.UIEvent.cancelBubble |
Set to true if you do not want this event to bubble any further.
char PowerUI.UIEvent.character |
The character that has been typed.
int PowerUI.UIEvent.clientX |
The x location of the mouse, as measured from the left of the screen.
int PowerUI.UIEvent.clientY |
The y location of the mouse, as measured from the top of the screen.
bool PowerUI.UIEvent.heldDown |
True if the mouse button or key is currently down.
int PowerUI.UIEvent.keyCode |
The keycode of the key pressed.
Element PowerUI.UIEvent.target |
The element that was clicked on or focused.
Event PowerUI.UIEvent.unityEvent |
The source Unity event.
|
get |
Is an alt key down?
|
get |
The mouse button that was pressed. See isLeftMouse and isRightMouse for clearer ways of using this value.
|
get |
Is a control key down?
|
get |
The document that this event has come from, if any.
|
get |
Mouseup/down only. Was it the left mouse button?
|
get |
Mouseup/down only. Was it the right mouse button?
|
get |
Is the left mouse button currently down?
|
get |
The position of the event relative to the top left corner of the target element in pixels.
|
get |
The position of the event relative to the top left corner of the target element in pixels.
|
get |
A 0-1 value of where this event occured relative to the target element. 0 is left edge, 1 is right edge.
|
get |
A 0-1 value of where this event occured relative to the target element. 0 is top edge, 1 is bottom edge.
|
get |
Is the right mouse button currently down?
|
get |
Is a shift key down?
|
get |
Gets the keycode as a UnityEngine.KeyCode.