Version: 2019.3
LanguageEnglish
  • C#

Event

class in UnityEngine

/

Implemented in:UnityEngine.IMGUIModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A UnityGUI event.

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

For each event OnGUI is called in the scripts; so OnGUI is potentially called multiple times per frame. Event.current corresponds to "current" event inside OnGUI call.

See Also: GUI Scripting Guide, EventType.

Static Properties

currentThe current event that's being processed right now.

Properties

altIs Alt/Option key held down? (Read Only)
buttonWhich mouse button was pressed.
capsLockIs Caps Lock on? (Read Only)
characterThe character typed.
clickCountHow many consecutive mouse clicks have we received.
commandIs Command/Windows key held down? (Read Only)
commandNameThe name of an ExecuteCommand or ValidateCommand Event.
controlIs Control key held down? (Read Only)
deltaThe relative movement of the mouse compared to last event.
displayIndexIndex of display that the event belongs to.
functionKeyIs the current keypress a function key? (Read Only)
isKeyIs this event a keyboard event? (Read Only)
isMouseIs this event a mouse event? (Read Only)
keyCodeThe raw key code for keyboard events.
modifiersWhich modifier keys are held down.
mousePositionThe mouse position.
numericIs the current keypress on the numeric keyboard? (Read Only)
pointerTypeThe type of pointer that created this event (for example, mouse, touch screen, pen).
pressureHow hard stylus pressure is applied.
shiftIs Shift held down? (Read Only)
typeThe type of event.

Public Methods

GetTypeForControlGet a filtered event type for a given control ID.
UseUse this event.

Static Methods

GetEventCountReturns the current number of events that are stored in the event queue.
KeyboardEventCreate a keyboard event.
PopEventGet the next queued [Event] from the event system.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961