JSDoc: Class: Key

# Class: Key

## action.InputState.Key()

Input state associated with a keyboard-type device.

## Constructor

#### new Key()

Source:
  - action.js, line 481

### Methods

#### isPressed(key) → {boolean}

Check whether |key| is pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | Normalized key value.

Source:
  - action.js, line 522

##### Returns:

True if |key| is in set of pressed keys.

Type
  boolean

#### press(key) → {boolean}

Add |key| to the set of pressed keys.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | Normalized key value.

Source:
  - action.js, line 535

##### Returns:

True if |key| is in list of pressed keys.

Type
  boolean

#### release(key) → {boolean}

Remove |key| from the set of pressed keys.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | Normalized key value.

Source:
  - action.js, line 548

##### Returns:

True if |key| was present before removal, false otherwise.

Type
  boolean

#### setModState(key, value)

Update modifier state according to |key|.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | Normalized key value of a modifier key.
`value` | boolean | Value to set the modifier attribute to.

Source:
  - action.js, line 502

##### Throws:

If |key| is not a modifier.

Type
  InvalidArgumentError