Perspective Event Types Reference
Perspective Events provide the opportunity to handle any type of user input or session event as you see fit. To this end, Perspective exposes dozens of configurable events in the Configure Events... dialog. The goal of this page is to explain what circumstances trigger each event.
If you choose to associate a given event with a script action, you will be provided with an event parameter in your script. List the properties of that event parameter, which differs for each broad class of event.
Component Events​
Component Events serve the same purpose as Vision extension functions, and are visible and configurable only on components for which they are applicable. The following components have component events:
Refer to the respective component pages for descriptions of component events.
Action Performed Event​
The action performed event is on many components where an action of some sort may occur. Typically this is triggered when the component is clicked on, or a selection within the component is made. While the action may differ between components, the event functions in the same way.
Applicable components:
- Date Time Input
- Date Time Picker
- Barcode Scanner Input
- Button
- Checkbox
- Dropdown
- Multi-State Button
- Numeric Entry Field
- One-Shot Button
- Radio Group
- Slider
- Toggle Switch
Event Name | Description |
---|---|
onActionPerformed | Fired when the action of the component is done, such as the button being pressed, or a checkbox being checked. |
System Events​
System Events are events that are not related to any specific user input, but to status changes of the component or view.
Event Name | React Event | Description |
---|---|---|
onStartup | componentDidMount |
|
onShutdown | componentWillUnmount |
|
Selection Event Properties​
There are no special properties associated with a selection event.
Mouse Events​
Event Name | Description |
---|---|
onClick | Fired when a mouse button is pressed and released over the element with the event configured. Note that some components, such as buttons, contain properties that disable the component. Clicking a disabled component will still trigger this onClick event. In cases where a script shouldn't run because its parent component is disabled, it is recommended to either use the onActionPerformed event instead (preferred) or have the script check if the component is enabled as part of the script's logic |
onContextMenu | Fired when the right mouse button is pressed and released over the element. |
onDoubleClick | Fired when a mouse button is pressed and released twice over the element. |
onMouseDown | Fired when a mouse button is pressed (not necessarily released) over the element. |
onMouseEnter | Fired when the mouse pointer is moved onto the element. |
onMouseLeave | Fired when the mouse pointer is moved off the element. |
onMouseMove | Fired continuously while the mouse moves over the element. |
onMouseOut | Fired when the mouse pointer is moved off the element. |
onMouseOver | Fired when the mouse pointer is moved onto the element. |
onMouseUp | Fired when a mouse button is released (not necessarily pressed) over the element. |
Mouse Event Properties​
Property Name | Description |
---|---|
altKey | Is true if the Alt key is pressed when the event is fired, and false otherwise. |
button | Indicates which mouse button was used to perform the click event. Possible options are:
For more information on this event, see the MDN documentation. |
buttons | For handling situations where multiple mouse buttons are pressed when the event is fired, buttons holds an integer sum, where each button is given the following values:
Thus, if the main and fourth buttons are pressed simultaneously, the buttons value will be 1 + 8 = 9. For more information, see the MDN documentation. |
clientX | Indicates the horizontal coordinate of the mouse click relative to the edge of the session. |
clientY | Indicates the vertical coordinate of the mouse click relative to the edge of the session. |
ctrlKey | Is true if the Ctrl key is pressed when the event is fired, and false otherwise. |
getModifierState(key) | Returns the current state of the specified modifier key: true if the modifier is active (i.e., the modifier key is pressed or locked), otherwise, false . |
metaKey | Is true if the meta key (like the Windows key in Windows) is pressed when the event is fired, and false otherwise. |
pageX | Same as clientX, except horizontal scrolling is taken into account. If some of the session is hidden on the left side, pageX will be larger than clientX. |
pageY | Same as clientY, except vertical scrolling is taken into account. If some of the session is hidden above, pageY will be larger than clientY . |
relatedTarget | A read-only property that is the secondary target for the mouse event, if there is one. For events with no secondary target, relatedTarget returns null. |
screenX | Provides the horizontal coordinate (offset) of the mouse pointer in global (screen) coordinates. |
screenY | Provides the vertical coordinate (offset) of the mouse pointer in global (screen) coordinates. |
shiftKey | Is true if the Shift key is pressed when the event is fired, and false otherwise. |
Pointer Events​
Pointer events have only recently become available on all of Perspective's supported browsers. For this reason, these events may not be available in older versions of Safari and Firefox. If pointer events do not fire as expected, we recommend upgrading your browser to the most current version.
Event Name | Description |
---|---|
onPointerOver | Fired when the pointer is moved onto the element. |
onPointerEnter | Fired when the pointer is moved onto the element. |
onPointerOut | Fired when the pointer is moved off the element. |
onPointerLeave | Fired when the pointer is moved off the element. |
onPointerUp | Fired when a pointer is released (not necessarily pressed) over the element. |
onPointerDown | Fired when a pointer is pressed (not necessarily released) over the element. |
onPointerCancel | Fired when a pointer has been disrupted, such as when a touch manipulation (i.e., panning or zooming) is initiated or more touch points are added to the surface than the device is capable of registering. |
onPointerMove | Fired continuously while the pointer moves over the element. |
Pointer Event Properties​
Property Name | Description |
---|---|
height | The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer. |
isPrimary | Indicates if the pointer represents the primary pointer of this pointer type. |
pointerId | A unique identifier for the pointer causing the event. |
pointerType | Indicates the device type that caused the event (mouse, pen, touch, etc). |
pressure | The normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. |
tangentialPressure | The normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control. |
tiltX | The plane angle (in degrees, in the range of -90 to 90) between the Y-Z plane and the plane container both the pointer (e.g. pen stylus) axis and the Y axis. |
tiltY | The plane angle (in degrees, in the range of -90 to 90) between the X-Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the X axis. |
twist | The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees, with a value in the range 0 to 359. |
width | The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer. |
Keyboard Events​
Event Name | Description |
---|---|
onKeyDown | Fired whenever any key is pressed while the element is focused. |
onKeyPress | Fired continuously while any key (other than Shift, Fn, and CapsLock) is in a pressed position and the element is focused.This event isn't recommend. Use onKeyDown instead. For more information, see the MDN documentation. |
onKeyUp | Fired whenever any key is released while the element is focused. |
Keyboard Event Properties​
Property Name | Description |
---|---|
altKey | Is true if the Alt key is pressed when the event is fired; false otherwise. |
charCode | Read-only property that returns the Unicode value of a character key pressed during a keypress event. Deprecated. Use the key property instead: MDN charCode |
ctrlKey | Is true if the Ctrl key is pressed when the event is fired; false otherwise. |
getModifierState(key) | Returns the current state of the specified modifier key: true if the modifier is active (i.e., the modifier key is pressed or locked); false otherwise. |
key | Read-only property that returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift as well as the |
keyCode | Read-only property representing a system and implementation dependent numerical code, identify the unmodified value of the pressed key. Deprecated: MDN keyCode |
location | Read-only property that returns a value representing the location of the key on the keyboard or other input device. |
metaKey | Is true if the meta key (like the Windows key on Windows) is pressed when the event is fired; false otherwise. |
repeat | Is true if the given key is being held down such that it is automatically repeating. |
shiftKey | Is true if the Shift key is pressed when the event is fired; false otherwise. |
which | Read-only property that returns the numeric keyCode of the key pressed, or the character code (charCode ) for an alphanumeric key pressed. Deprecated: MDN which |
Text Composition Events​
The following events are triggered via composition - meaning cases where supplementary or alternative means are used to input text. For example, building logograms from base characters, or when voice commands are converted into text via speech recognition.
Event Name | Description |
---|---|
onCompositionEnd | Triggers when composition ends on an input component. |
onCompositionStart | Triggers when composition begins on an input component. |
onCompositionUpdate | Triggers when a new character is received while composing on an input component. |
Selection Event Properties​
There are no special properties associated with a selection event.
Focus Events​
Event Name | Description |
---|---|
onFocus | Fired whenever the element is focused. Usually, a component or container becomes focused when the user starts to interact with it. |
onBlur | Fired when the element loses focus. This usually happens when the user focuses something else. |
Selection Event Properties​
There are no special properties associated with a selection event.
Selection Events​
Event Name | Description |
---|---|
onSelect | Fired after a section of text is selected in the element. |
Selection Event Properties​
There are no special properties associated with a selection event.
Touch Events​
Event Name | Description |
---|---|
onTouchCancel | Fired when a touch point has been disrupted, such as when a touch manipulation (i.e., panning or zooming) is initiated or more touch points are added to the surface than the device is capable of registering. |
onTouchEnd | Fired when the user removes a touch point from the touch surface, including cases where the touch point physically leaves the touch surface, such as being dragged off of the screen. |
onTouchMove | Fired when a touch point has moved along the touch surface. |
onTouchStart | Fired when the user has touched the surface of a touch capable device. |
Touch Event Properties​
Property Name | Description |
---|---|
altKey | Is true if the Alt key is pressed when the event is fired; false otherwise. |
ctrlKey | Is true if the Ctrl key is pressed when the event is fired, and false otherwise. |
metaKey | Is true if the meta key (like the Windows key in Windows) is pressed when the event is fired; false otherwise. |
shiftKey | Is true if the Shift key is pressed when the event is fired; false otherwise. |
Wheel Events​
Event Name | Description |
---|---|
onWheel | Fired whenever the mouse's scroll wheel is used over the element. |
Wheel Event Properties​
Property Name | Description |
---|---|
deltaMode | Indicates the unit associated with the other three properties. Possible values are:
|
deltaX | Indicates the length of a horizontal scroll. Most mouse devices do not possess horizontal scrolling capability. Scrolling right will return a positive value, and scrolling left will return a negative value. |
deltaY | Indicates the length of a vertical scroll. This is by far the most common type of scroll; it coincides with the upward and downward movement of a typical mouse scroll wheel. deltaY will be positive when scrolling down, and negative when scrolling up. |
deltaZ | Indicates the length of a depth scroll. Not many mouse devices deliver this kind of scroll; typically only a "3D" mouse would control this scroll type. The value is positive when scrolling in, and negative when scrolling out. |