# Class: Key

## Key()

#### new Key()

Key is used by Keyboard, Pointer, etc, to represent a key state.

Source:
  - input/Key.js, line 6

### Members

#### (static) DOWN :number

Key down event.

##### Type:

- number

Source:
  - input/Key.js, line 35

#### (static) RESET :number

Key reset event.

##### Type:

- number

Source:
  - input/Key.js, line 49

#### (static) UP :number

Key up event.

##### Type:

- number

Source:
  - input/Key.js, line 42

#### justPressed :boolean

Indicates if this key was just pressed.

##### Type:

- boolean

Source:
  - input/Key.js, line 20

#### justReleased :boolean

Indicates if this key was just released.

##### Type:

- boolean

Source:
  - input/Key.js, line 27

#### pressed :boolean

Indicates if this key is currently pressed.

##### Type:

- boolean

Source:
  - input/Key.js, line 13

### Methods

#### reset()

Reset key to default values.

Source:
  - input/Key.js, line 103

#### set(justPressed, pressed, justReleased)

Set this key attributes manually.

##### Parameters:

Name | Type | Description
--- | --- | ---
`justPressed` | boolean | Indicates if the button was just pressed.
`pressed` | boolean | Indicates if the button is currently being pressed.
`justReleased` | boolean | Indicates if the button was just released.

Source:
  - input/Key.js, line 93

#### update(action)

Update Key status based on new key state.

##### Parameters:

Name | Type | Description
--- | --- | ---
`action` | number | Key action that was performed.

Source:
  - input/Key.js, line 58