Interface IPointerEvent
This interface describes properties available to pointer events.
Namespace: UnityEngine.UIElements
Syntax
public interface IPointerEvent
Properties
actionKey
Gets a boolean value that indicates whether the platform-specific action key is pressed. True means the action key is pressed. False means it isn't.
Declaration
bool actionKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
The platform-specific action key is Cmd on macOS, and Ctrl on all other platforms.
altitudeAngle
Gets the angle of the stylus relative to the surface, in radians
Declaration
float altitudeAngle { get; }
Property Value
Type | Description |
---|---|
Single |
Remarks
A value of 0 indicates that the stylus is parallel to the surface. A value of pi/2 indicates that it is perpendicular to the surface.
altKey
Gets a boolean value that indicates whether the Alt key is pressed. True means the Alt key is pressed. False means it isn't.
Declaration
bool altKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
azimuthAngle
Gets the angle of the stylus relative to the x-axis, in radians.
Declaration
float azimuthAngle { get; }
Property Value
Type | Description |
---|---|
Single |
Remarks
A value of 0 indicates that the stylus is pointed along the x-axis of the device.
button
Gets a value that indicates which mouse button was pressed: 0 is the left button, 1 is the right button, 2 is the middle button.
Declaration
int button { get; }
Property Value
Type | Description |
---|---|
Int32 |
clickCount
Gets the number of times the button was pressed.
Declaration
int clickCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
commandKey
Gets a boolean value that indicates whether the Windows/Cmd key is pressed. True means the Windows/Cmd key is pressed. False means it isn't.
Declaration
bool commandKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
ctrlKey
Gets a boolean value that indicates whether the Ctrl key is pressed. True means the Ctrl key is pressed. False means it isn't.
Declaration
bool ctrlKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
deltaPosition
Gets the difference between the pointer's position during the previous mouse event and its position during the current mouse event.
Declaration
Vector3 deltaPosition { get; }
Property Value
Type | Description |
---|---|
Vector3 |
deltaTime
Gets the amount of time that has elapsed since the last recorded change in pointer values, in seconds.
Declaration
float deltaTime { get; }
Property Value
Type | Description |
---|---|
Single |
isPrimary
Gets a boolean value that indicates whether the pointer is a primary pointer. True means the pointer is a primary pointer. False means it isn't.
Declaration
bool isPrimary { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
A primary pointer is a pointer that manipulates the mouse cursor. The mouse pointer is always a primary pointer. For touch events, the first finger that touches the screen is the primary pointer. Once it is processed, a pointer event from a primary pointer generates compatibility mouse events.
localPosition
Gets the pointer position in the current target's coordinate system.
Declaration
Vector3 localPosition { get; }
Property Value
Type | Description |
---|---|
Vector3 |
modifiers
Gets flags that indicate whether modifier keys (Alt, Ctrl, Shift, Windows/Cmd) are pressed.
Declaration
EventModifiers modifiers { get; }
Property Value
Type | Description |
---|---|
EventModifiers |
pointerId
Gets the identifier of the pointer that sends the event.
Declaration
int pointerId { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
If the mouse sends the event, the identifier is set to 0. If a touchscreen device sends the event, the identifier is set to the finger ID, which ranges from 1 to the number of touches the device supports.
pointerType
Gets the type of pointer that created the event.
Declaration
string pointerType { get; }
Property Value
Type | Description |
---|---|
String |
Remarks
This value is taken from the values defined in PointerType
.
position
Gets the pointer position in the Screen or World coordinate system.
Declaration
Vector3 position { get; }
Property Value
Type | Description |
---|---|
Vector3 |
pressedButtons
Gets a bitmask that describes the buttons that are currently pressed.
Declaration
int pressedButtons { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Pressing a mouse button sets a bit. Releasing the button clears the bit. The left mouse button sets/clears Bit 0. The right mouse button sets/clears Bit 1. The middle mouse button sets/clears Bit 2. Additional buttons set/clear other bits.
pressure
Gets the amount of pressure currently applied by a touch.
Declaration
float pressure { get; }
Property Value
Type | Description |
---|---|
Single |
Remarks
If the device does not report pressure, the value of this property is 1.0f.
radius
Gets an estimate of the radius of a touch.
Declaration
Vector2 radius { get; }
Property Value
Type | Description |
---|---|
Vector2 |
Remarks
Add radiusVariance
to get the maximum touch radius, subtract it to get the minimum touch radius.
radiusVariance
Gets the accuracy of the touch radius.
Declaration
Vector2 radiusVariance { get; }
Property Value
Type | Description |
---|---|
Vector2 |
Remarks
Add this value to the radius to get the maximum touch radius, subtract it to get the minimum touch radius.
shiftKey
Gets a boolean value that indicates whether the Shift key is pressed. True means the Shift key is pressed. False means it isn't.
Declaration
bool shiftKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
tangentialPressure
Gets the pressure applied to an additional pressure-sensitive control on the stylus.
Declaration
float tangentialPressure { get; }
Property Value
Type | Description |
---|---|
Single |
twist
Gets the rotation of the stylus around its axis, in radians.
Declaration
float twist { get; }
Property Value
Type | Description |
---|---|
Single |