Skip to main content

Class: KeyboardEventExt<T>

Events.KeyboardEventExt

Represents a custom extended keyboard event.

Type parameters

NameTypeDescription
TObject3DThe type of the primary target for the event (default is Object3D).

Hierarchy

Constructors

constructor

new KeyboardEventExt<T>(event, cancelable)

Type parameters

NameType
TObject3D<Object3DEventMap>

Parameters

NameTypeDescription
eventKeyboardEventOriginal dom event.
cancelablebooleanA boolean value indicating whether the event is cancelable.

Overrides

EventExt.constructor

Defined in

src/events/Events.ts:338

Properties

cancelable

Readonly cancelable: any

A boolean value indicating whether the event is cancelable.

Inherited from

EventExt.cancelable

Defined in

src/events/Events.ts:116


currentTarget

currentTarget: T

A reference to the currently registered target for the event. This is the object to which the event is currently slated to be sent. It's possible this has been changed along the way through retargeting.

Inherited from

EventExt.currentTarget

Defined in

src/events/Events.ts:118


domEvent

Readonly domEvent: KeyboardEvent

Original dom event.

Defined in

src/events/Events.ts:316


timeStamp

Readonly timeStamp: number

The time at which the event was created (in milliseconds). By specification, this value is time since epoch—but in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead.

Inherited from

EventExt.timeStamp

Defined in

src/events/Events.ts:124

Accessors

altKey

get altKey(): boolean

Returns a boolean value that is true if the Alt (Option or ⌥ on macOS) key was active when the key event was generated.

Returns

boolean

Defined in

src/events/Events.ts:318


bubbles

get bubbles(): boolean

A boolean value indicating whether or not the event bubbles up through the DOM.

Returns

boolean

Inherited from

EventExt.bubbles

Defined in

src/events/Events.ts:114


code

get code(): string

Returns a string with the code value of the physical key represented by the event.

Returns

string

Defined in

src/events/Events.ts:320


ctrlKey

get ctrlKey(): boolean

Returns a boolean value that is true if the Ctrl key was active when the key event was generated.

Returns

boolean

Defined in

src/events/Events.ts:322


defaultPrevented

get defaultPrevented(): boolean

Indicates whether or not the call to event.preventDefault() canceled the event.

Returns

boolean

Inherited from

EventExt.defaultPrevented

Defined in

src/events/Events.ts:120


key

get key(): string

Returns a string representing the key value of the key represented by the event.

Returns

string

Defined in

src/events/Events.ts:324


location

get location(): number

Returns a number representing the location of the key on the keyboard or other input device. Visit https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/location for more info.

Returns

number

Defined in

src/events/Events.ts:326


metaKey

get metaKey(): boolean

Returns a boolean value that is true if the Meta key (on Mac keyboards, the ⌘ Command key; on Windows keyboards, the Windows key (⊞)) was active when the key event was generated.

Returns

boolean

Defined in

src/events/Events.ts:328


repeat

get repeat(): boolean

Returns a boolean value that is true if the key is being held down such that it is automatically repeating.

Returns

boolean

Defined in

src/events/Events.ts:330


shiftKey

get shiftKey(): boolean

Returns a boolean value that is true if the Shift key was active when the key event was generated.

Returns

boolean

Defined in

src/events/Events.ts:332


target

get target(): T

A reference to the object to which the event was originally dispatched.

Returns

T

Inherited from

EventExt.target

Defined in

src/events/Events.ts:122


type

get type(): keyof MiscEvents | keyof InteractionEvents<Object3D<Object3DEventMap>, Object3D<Object3DEventMap>, Object3D<Object3DEventMap> | InstancedMeshEntity> | keyof UpdateEvents

The case-insensitive name identifying the type of the event.

Returns

keyof MiscEvents | keyof InteractionEvents<Object3D<Object3DEventMap>, Object3D<Object3DEventMap>, Object3D<Object3DEventMap> | InstancedMeshEntity> | keyof UpdateEvents

Inherited from

EventExt.type

Defined in

src/events/Events.ts:126

Methods

getModifierState

getModifierState(keyArg): boolean

Returns a boolean value indicating if a modifier key such as Alt, Shift, Ctrl, or Meta, was pressed when the event was created.

Parameters

NameType
keyArgstring

Returns

boolean

Defined in

src/events/Events.ts:344


preventDefault

preventDefault(): void

Cancels the event.

Returns

void

Inherited from

EventExt.preventDefault

Defined in

src/events/Events.ts:142


stopImmediatePropagation

stopImmediatePropagation(): void

For this particular event, prevent all other listeners from being called. This includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance).

Returns

void

Inherited from

EventExt.stopImmediatePropagation

Defined in

src/events/Events.ts:147


stopPropagation

stopPropagation(): void

Stops the propagation of events further along in the Object3D hierarchy.

Returns

void

Inherited from

EventExt.stopPropagation

Defined in

src/events/Events.ts:152