Home Reference Source
import {Keybinding} from 'shapez.io/js/game/key_action_mapper.js'
public class | source

Keybinding

Constructor Summary

Public Constructor
public

constructor(keyMapper: KeyActionMapper, app: Application, param0: object)

Member Summary

Public Members
public

app: *

public

builtin: *

public

keyCode: *

public
public get

Returns whether this binding is currently pressed

public
public

signal: *

public

toggled: *

Method Summary

Public Methods
public

add(receiver: function(): void, scope: object=)

Adds an event listener

public

appendLabelToElement(elem: Element): HTMLElement

public

Remvoes all signal receivers

public

Returns the key code as a nice string

Public Constructors

public constructor(keyMapper: KeyActionMapper, app: Application, param0: object) source

Params:

NameTypeAttributeDescription
keyMapper KeyActionMapper
app Application
param0 object
param0.keyCode number
param0.builtin boolean=
param0.repeated boolean=

Public Members

public app: * source

public builtin: * source

public keyCode: * source

public keyMapper: * source

public get pressed: boolean: boolean source

Returns whether this binding is currently pressed

Return:

boolean

public repeated: * source

public signal: * source

public toggled: * source

Public Methods

public add(receiver: function(): void, scope: object=) source

Adds an event listener

Params:

NameTypeAttributeDescription
receiver function(): void
scope object=

public appendLabelToElement(elem: Element): HTMLElement source

Params:

NameTypeAttributeDescription
elem Element

Return:

HTMLElement

the created element, or null if the keybindings are not shown

public clearSignalReceivers() source

Remvoes all signal receivers

public getKeyCodeString(): * source

Returns the key code as a nice string

Return:

*