This class manages input such as clicking, hovering and keypresses.
Static Public Member Functions | |
static void | Setup () |
Sets up the mouse and drag info. More... | |
static void | AddSystemMouse () |
Adds the system mouse if one is needed. More... | |
static void | OnScrollWheel (Vector2 delta) |
Called when a scrollwheel changes by the given delta amount. More... | |
static void | OnKeyPress (bool down, char character, int keyCode) |
Tells the UI a key was pressed. More... | |
static HtmlDocument | MapToUIPanel (ref Vector2 screenPos) |
static bool | AcceptsInput (Element e) |
True if the given element should accept an input event. Html and body don't accept input in PowerUI (the event has to pass through) unless they have a background. More... | |
static Element | ElementFromPoint (ref float x, ref float y) |
Finds an element from the given screen location. This fires a ray into the scene if the point isn't on the main UI and caches the hit in the given pointer. X and Y are updated with the document-relative point if it's on a WorldUI/ on the Unity UI. More... | |
static Element | ElementFromPoint (ref float x, ref float y, InputPointer pointer) |
Finds an element from the given screen location. This fires a ray into the scene if the point isn't on the main UI and caches the hit in the given pointer. X and Y are updated with the document-relative point if it's on a WorldUI/ on the Unity UI. More... | |
static Element | GetDraggable (Element current) |
Looks for any element with the 'draggable' attribute. More... | |
static IEventTarget | ResolveTarget (GameObject toResolve) |
Attempts to resolve a Gameobject to an event target. Prefers to use Input.TargetResolver but falls back searching for a script on the gameobject which implements it. Will search up the hierarchy too. More... | |
static void | Update () |
Updates mouse overs, touches and the mouse position. More... | |
Static Public Attributes | |
static EventTarget | Unhandled =new EventTarget() |
Clicks, taps and keypresses that pass through the UI and don't hit any WorldUI's will end up being received here. Note that PowerUI already does raycasting so use the MouseEvent.rayHit property. More... | |
static float | MinimumDragStartDistance =20f |
Varies based on DPI. On a 96dpi screen, this is 20px. (0.2777 * DPI). More... | |
static MousePointer | SystemMouse |
The system mouse pointer if there is one. Edit this to e.g. fix the mouse in a particular position. More... | |
static HtmlDocument | LastFocusedDocument |
The latest document that got focused. More... | |
static bool | CreateSystemMouse =true |
True if a system mouse should be created when on desktops. More... | |
static UnityEngine.UI.GraphicRaycaster | UnityUICaster |
True if the input searcher should also hit the Unity UI. More... | |
static float | ScrollWheelMultiplier =150f |
Scrollwheel deltas are typically either -1 or 1. Those values are multiplied by this. More... | |
static TargetResolveDelegate | TargetResolver |
Used to resolve GameObjects to an IEventTarget. This typically happens if you have e.g. some instance that represents items/ players and you want that object to receive the event. More... | |
Static Package Attributes | |
static bool | PointersInvalid =true |
True if the pointers are invalid. The things underneath them all will be recomputed on the next update. More... | |
Properties | |
static int | PointerCount [get] |
The raw pointer count. See InputPointer.AllRaw for more info. More... | |
static InputPointer[] | PointersRaw [get] |
The raw set of all current pointing devices. See InputPointer.AllRaw for more info. More... | |
static Camera | CameraFor3DInput [get, set] |
The camera used for 3D input. Defaults to Camera.main if this is null. More... | |
static EventTarget | ActiveReceiver [get] |
Either a focused node or the Input.Unhandled set, depending on if anything is actually focused. More... | |
Static Private Attributes | |
static Camera | CameraFor3DInput_ |
The camera used for 3D input. Defaults to Camera.main if this is null. More... | |
|
inlinestatic |
True if the given element should accept an input event. Html and body don't accept input in PowerUI (the event has to pass through) unless they have a background.
|
inlinestatic |
Adds the system mouse if one is needed.
|
inlinestatic |
|
inlinestatic |
Looks for any element with the 'draggable' attribute.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Called when a scrollwheel changes by the given delta amount.
|
inlinestatic |
Attempts to resolve a Gameobject to an event target. Prefers to use Input.TargetResolver but falls back searching for a script on the gameobject which implements it. Will search up the hierarchy too.
|
inlinestatic |
Sets up the mouse and drag info.
|
inlinestatic |
Updates mouse overs, touches and the mouse position.
|
staticprivate |
The camera used for 3D input. Defaults to Camera.main if this is null.
|
static |
True if a system mouse should be created when on desktops.
|
static |
The latest document that got focused.
|
static |
Varies based on DPI. On a 96dpi screen, this is 20px. (0.2777 * DPI).
|
staticpackage |
True if the pointers are invalid. The things underneath them all will be recomputed on the next update.
|
static |
Scrollwheel deltas are typically either -1 or 1. Those values are multiplied by this.
|
static |
The system mouse pointer if there is one. Edit this to e.g. fix the mouse in a particular position.
|
static |
Used to resolve GameObjects to an IEventTarget. This typically happens if you have e.g. some instance that represents items/ players and you want that object to receive the event.
|
static |
Clicks, taps and keypresses that pass through the UI and don't hit any WorldUI's will end up being received here. Note that PowerUI already does raycasting so use the MouseEvent.rayHit property.
|
static |
True if the input searcher should also hit the Unity UI.
|
staticget |
Either a focused node or the Input.Unhandled set, depending on if anything is actually focused.
|
staticgetset |
The camera used for 3D input. Defaults to Camera.main if this is null.
|
staticget |
The raw pointer count. See InputPointer.AllRaw for more info.
|
staticget |
The raw set of all current pointing devices. See InputPointer.AllRaw for more info.