KeyController

KeyController

new KeyController(containeropt)

Source:
Name Type Default Description
container? Window | Document | HTMLElement window

Extends

  • EventEmitter

Members

(static) global

Source:

altKey

Source:

ctrlKey

Source:

metaKey

Source:

shiftKey

Source:

Methods

(static) getCombi(e, keyopt) → {string[]}

Source:
Name Type Default Description
e KeyboardEvent
key? string getKey(e.keyCode, e.key)
Returns:
Type
string[]

(static) getKey(keyCode, keyNameopt) → {string}

Source:
Name Type Description
keyCode number
keyName? string
Returns:
Type
string

(static) getModifierCombi(e) → {string[]}

Source:
Name Type Description
e KeyboardEvent
Returns:
Type
string[]

destroy()

Source:

keydown(comb, callbackopt) → {this}

Source:
Name Type Description
comb string | string[] | ((e: KeyControllerEvent) => void) | ...
callback? (e: KeyControllerEvent) => void

keydown(comb, callback) → {this}

Name Type Description
comb string | string[]
callback (e: KeyControllerEvent) => void

keydown(callback) → {this}

Name Type Description
callback (e: KeyControllerEvent) => void
Returns:
Type
this

keyup(comb, callbackopt) → {this}

Source:
Name Type Description
comb string | string[] | ((e: KeyControllerEvent) => void) | ...
callback? (e: KeyControllerEvent) => void

keyup(comb, callback) → {this}

Name Type Description
comb string | string[]
callback (e: KeyControllerEvent) => void

keyup(callback) → {this}

Name Type Description
callback (e: KeyControllerEvent) => void
Returns:
Type
this

offKeydown(comb, callbackopt) → {this}

Source:
Name Type Description
comb string | string[] | ((e: KeyControllerEvent) => void) | ...
callback? (e: KeyControllerEvent) => void

offKeydown(comb, callback) → {this}

Name Type Description
comb string | string[]
callback? (e: KeyControllerEvent) => void

offKeydown(callback) → {this}

Name Type Description
callback (e: KeyControllerEvent) => void
Returns:
Type
this

offKeyup(comb, callbackopt) → {this}

Source:
Name Type Description
comb string | string[] | ((e: KeyControllerEvent) => void) | ...
callback? (e: KeyControllerEvent) => void

offKeyup(comb, callback) → {this}

Name Type Description
comb string | string[]
callback? (e: KeyControllerEvent) => void

offKeyup(callback) → {this}

Name Type Description
callback (e: KeyControllerEvent) => void
Returns:
Type
this

Type Definitions

KeyControllerEvent

Source:
Properties:
Name Type Description
inputEvent KeyboardEvent
isToggle boolean
key string
keyCode number
ctrlKey boolean
altKey boolean
shiftKey boolean
metaKey boolean
Type:
  • TSInterface