Skip to main content

KeyEvent

Event thrown on a game object for a key event

Hierarchy

Index

Constructors

constructor

  • new KeyEvent(key: Keys, value?: string, originalEvent?: KeyboardEvent): KeyEvent
  • Parameters

    • key: Keys

      The key responsible for throwing the event

    • optionalvalue: string

      The key's typed value the browser detected

    • optionaloriginalEvent: KeyboardEvent

      The original keyboard event that Excalibur handled

    Returns KeyEvent

Properties

publickey

key: Keys

The key responsible for throwing the event

publicoptionaloriginalEvent

originalEvent?: KeyboardEvent

The original keyboard event that Excalibur handled

publicother

other: any = null

Other target object for this event

publictarget

target: any

Target object for this event.

publicoptionalvalue

value?: string

The key's typed value the browser detected

Accessors

publicbubbles

  • get bubbles(): boolean
  • set bubbles(value: boolean): void
  • If set to false, prevents event from propagating to other actors. If true it will be propagated to all actors that apply.


    Returns boolean

  • Parameters

    • value: boolean

    Returns void

Methods

publicstopPropagation

  • stopPropagation(): void
  • Prevents event from bubbling


    Returns void