# Event

> A UnityGUI event.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule

```csharp
public sealed class Event
```

## Remarks

Events correspond to user input (key presses, mouse actions), or are UnityGUI layout or rendering events.

For each event [MonoBehaviour.OnGUI()](/engine/6000.0/script-reference/unityengine/monobehaviour/ongui.md) is called in the scripts; so OnGUI is potentially called multiple times per frame.  [Event.current](/engine/6000.0/script-reference/unityengine/event/current.md) corresponds to "current" event inside OnGUI call.

Additional Resources: [GUI Scripting Guide](/engine/6000.0/manual/uitoolkits/uielements/ui-imgui/guiscripting-guide.md), [EventType](/engine/6000.0/script-reference/unityengine/eventtype.md).

## Properties

| Property                                                                            | Description                                                                                                                                                         |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [alt](/engine/6000.0/script-reference/unityengine/event/alt.md)                     | Is Alt/Option key held down? (Read Only)                                                                                                                            |
| [button](/engine/6000.0/script-reference/unityengine/event/button.md)               | Which mouse button was pressed.                                                                                                                                     |
| [capsLock](/engine/6000.0/script-reference/unityengine/event/capslock.md)           | Is Caps Lock on? (Read Only)                                                                                                                                        |
| [character](/engine/6000.0/script-reference/unityengine/event/character.md)         | The character typed.                                                                                                                                                |
| [clickCount](/engine/6000.0/script-reference/unityengine/event/clickcount.md)       | How many consecutive mouse clicks have we received.                                                                                                                 |
| [command](/engine/6000.0/script-reference/unityengine/event/command.md)             | Is Command/Windows key held down? (Read Only)                                                                                                                       |
| [commandName](/engine/6000.0/script-reference/unityengine/event/commandname.md)     | The name of an ExecuteCommand or ValidateCommand Event.                                                                                                             |
| [control](/engine/6000.0/script-reference/unityengine/event/control.md)             | Is Control key held down? (Read Only)                                                                                                                               |
| [delta](/engine/6000.0/script-reference/unityengine/event/delta.md)                 | The relative movement of the mouse compared to last event.                                                                                                          |
| [displayIndex](/engine/6000.0/script-reference/unityengine/event/displayindex.md)   | Index of display that the event belongs to.                                                                                                                         |
| [functionKey](/engine/6000.0/script-reference/unityengine/event/functionkey.md)     | Is the current keypress a function key? (Read Only)                                                                                                                 |
| [isKey](/engine/6000.0/script-reference/unityengine/event/iskey.md)                 | Is this event a keyboard event? (Read Only)                                                                                                                         |
| [isMouse](/engine/6000.0/script-reference/unityengine/event/ismouse.md)             | Is this event a mouse event? (Read Only)                                                                                                                            |
| [keyCode](/engine/6000.0/script-reference/unityengine/event/keycode.md)             | The raw key code for keyboard events.                                                                                                                               |
| [modifiers](/engine/6000.0/script-reference/unityengine/event/modifiers.md)         | Which modifier keys are held down.                                                                                                                                  |
| [mousePosition](/engine/6000.0/script-reference/unityengine/event/mouseposition.md) | The mouse position.                                                                                                                                                 |
| [numeric](/engine/6000.0/script-reference/unityengine/event/numeric.md)             | Is the current keypress on the numeric keyboard? (Read Only)                                                                                                        |
| [penStatus](/engine/6000.0/script-reference/unityengine/event/penstatus.md)         | Specifies the state of the pen. For example, whether the pen is in contact with the screen or tablet, whether the pen is inverted, and whether buttons are pressed. |
| [pointerType](/engine/6000.0/script-reference/unityengine/event/pointertype.md)     | The type of pointer that created this event (for example, mouse, touch screen, pen).                                                                                |
| [pressure](/engine/6000.0/script-reference/unityengine/event/pressure.md)           | How hard pen pressure is applied, normalized between 0 (no pressure) and 1 (maximum pressure).                                                                      |
| [shift](/engine/6000.0/script-reference/unityengine/event/shift.md)                 | Is Shift held down? (Read Only)                                                                                                                                     |
| [tilt](/engine/6000.0/script-reference/unityengine/event/tilt.md)                   | Specifies the angle of the pen relative to the X and Y axes, expressed in radians.                                                                                  |
| [twist](/engine/6000.0/script-reference/unityengine/event/twist.md)                 | Specifies the rotation of the pen around its axis, expressed in radians. The default value is 0.                                                                    |
| [type](/engine/6000.0/script-reference/unityengine/event/type.md)                   | The type of event.                                                                                                                                                  |

## Static Properties

| Property                                                                | Description                                         |
| ----------------------------------------------------------------------- | --------------------------------------------------- |
| [current](/engine/6000.0/script-reference/unityengine/event/current.md) | The current event that's being processed right now. |

## Methods

| Method                                                                                      | Description                                       |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| [GetTypeForControl](/engine/6000.0/script-reference/unityengine/event/gettypeforcontrol.md) | Get a filtered event type for a given control ID. |
| [Use](/engine/6000.0/script-reference/unityengine/event/use.md)                             | Use this event.                                   |

## Static Methods

| Method                                                                              | Description                                                              |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [GetEventCount](/engine/6000.0/script-reference/unityengine/event/geteventcount.md) | Returns the current number of events that are stored in the event queue. |
| [KeyboardEvent](/engine/6000.0/script-reference/unityengine/event/keyboardevent.md) | Create a keyboard event.                                                 |
| [PopEvent](/engine/6000.0/script-reference/unityengine/event/popevent.md)           | Get the next queued \[Event] from the event system.                      |
