UI Toolkit sends an event when a user interacts with elements from UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary Toolkit and changes the state of those elements. For example, the following actions all have associated:
The event design is similar to the Event interface for HTML elements.
Event types fit into a hierarchy based on the EventBase class. Each event family implements an interface that defines the common characteristics for all events of the same family. For example, BlurEvent
and FocusEvent
use the FocusEventBase class.
Select any of the event types listed below for more information on the event, its parent class, and links to the API documentation.
The following table is a simple overview of each event type. For more information on an event, see the pages listed above.
Event type | Description | Trickles down | Bubbles up | Cancellable | |
---|---|---|---|---|---|
Capture events | |||||
MouseCaptureEvent | Sent when an element takes the mouse capture. | Yes | Yes | ||
MouseCaptureOutEvent | Sent when an element releases or otherwise loses the mouse capture. | Yes | Yes | ||
PointerCaptureEvent | Sent when an element captures a pointer. | Yes | Yes | ||
PointerCaptureOutEvent | Sent when an element releases a pointer. | Yes | Yes | ||
Change events | |||||
ChangeEvent | A generic event sent when the value of an element changes. | Yes | Yes | ||
Command events | |||||
ValidateCommandEvent | IMGUI sends this event while it determines whether the command will be handled by an element in the panel. | Yes | Yes | Yes | |
ExecuteCommandEvent | IMGUI sends this event when an element in the panel should execute a command. | Yes | Yes | Yes | |
Drag events | |||||
DragExitedEvent | Sent when the drag and drop process ends. | Yes | Yes | ||
DragUpdatedEvent | Sent when the dragged element moves over a drop target. | Yes | Yes | Yes | |
DragPerformEvent | Sent when the dragged element drops onto an acceptable target. | Yes | Yes | Yes | |
DragEnterEvent | The dragged element entered a new VisualElement . This event is sent when the drag operation begins. |
Yes | |||
DragLeaveEvent | The dragged element exited the current drop target. This event is sent when the drag operation ends. | Yes | |||
Focus events | |||||
FocusOutEvent | Sent before an element loses focus. | Yes | Yes | ||
FocusInEvent | Sent before an element gains focus. | Yes | Yes | ||
BlurEvent | Sent after an element has lost focus. | Yes | |||
FocusEvent | Sent after an element has gained focus. | Yes | |||
IMGUI events | |||||
IMGUIEvent | Sent to encapsulate IMGUI-specific events. | Yes | Yes | Yes | |
Input events | |||||
InputEvent | Sent when data is input to a visual element, typically a control. | ||||
Keyboard events | |||||
KeyDownEvent | Sent when the user presses a key on the keyboard. | Yes | Yes | Yes | |
KeyUpEvent | Sent when the user releases a key on the keyboard. | Yes | Yes | Yes | |
Layout events | |||||
GeometryChangedEvent | Event sent when either the position or the dimensions of an element changes. | ||||
Mouse events | |||||
MouseDownEvent | Sent when the user presses a mouse button. | Yes | Yes | Yes | |
MouseUpEvent | Sent when the user releases a mouse button. | Yes | Yes | Yes | |
MouseMoveEvent | Sent when the user moves the mouse. | Yes | Yes | Yes | |
WheelEvent | Sent when the user activates the mouse wheel. | Yes | Yes | Yes | |
MouseEnterWindowEvent | Sent when the mouse enters a window. | Yes | |||
MouseLeaveWindowEvent | Sent when the mouse leaves a window. | Yes | |||
MouseEnterEvent | Sent when the mouse enters an element or one of its descendants. | Yes | Yes | ||
MouseLeaveEvent | Sent when the mouse leaves an element or one of its descendants. | Yes | Yes | ||
MouseOverEvent | Sent when the mouse enters an element. | Yes | Yes | Yes | |
MouseOutEvent | Sent when the mouse leaves an element. | Yes | Yes | Yes | |
ContextClickEvent (obsolete) | Sent when the user presses and releases the third mouse button. Exists for backwards compatibility with IMGUI. | Yes | Yes | Yes | |
Pointer events | |||||
PointerDownEvent | Sent when you press a pointer. | Yes | Yes | Yes | |
PointerUpEvent | Sent when you release a pointer. | Yes | Yes | Yes | |
PointerMoveEvent | Sent when the pointer changes state. | Yes | Yes | Yes | |
PointerEnterEvent | Sent when the pointer enters a visual element, or one of its descendants. | Yes | Yes | ||
PointerLeaveEvent | Sent when the pointer leaves a visual element and all of its descendants. | Yes | Yes | ||
PointerOverEvent | Sent when the pointer enters a visual element. | Yes | Yes | Yes | |
PointerOutEvent | Sent when the pointer leaves a visual element. | Yes | Yes | Yes | |
PointerStationaryEvent | Sent when a pointer type (like a stylus or finger) doesn’t change for a set amount of time determined by the operating system. | Yes | Yes | Yes | |
PointerCancelEvent | Sent when a pointer action is cancelled by the operating system. | Yes | Yes | Yes | |
Panel events | |||||
AttachToPanelEvent | Sent right after an element attaches to a panel. | ||||
DetachFromPanelEvent | Sent just before an element detaches from a panel. | ||||
Tooltip events | |||||
TooltipEvent | Tooltip is sent just before a tooltip is displayed. | Yes | Yes | Yes |
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.