Simple KeyCombo class

class

  KeyCombo

### Hierarchy

- KeyCombo

## Index

### Constructors

- constructor

### Properties

- keys
- stateKeys

### Methods

- addEvent
- fromString
- getNonSkipKeys
- getSkipKeys
- isEqual
- isSkipKey
- parse
- splitCombo

## Constructors

### constructor

- new KeyCombo(keys?: Set<number>, stateKeys?: ComboStateKeys): KeyCombo

- - Defined in key-combo.ts:38

  #### Parameters

  - ##### Default value keys: Set<number> = new Set<number>()

  - ##### Default value stateKeys: ComboStateKeys = new ComboStateKeys()

  #### Returns KeyCombo

## Properties

### keys

keys: Set<number>

- Defined in key-combo.ts:40

### stateKeys

stateKeys: ComboStateKeys

- Defined in key-combo.ts:41

## Methods

### addEvent

- addEvent(ev: KeyboardEvent): boolean

- - Defined in key-combo.ts:118

  Creates an instance of KeyCombo, given an string.

  #### Parameters

  - ##### ev: KeyboardEvent

  #### Returns boolean

### fromString

- fromString(comboStr: string): KeyCombo

- - Defined in key-combo.ts:51

  Creates an instance of KeyCombo, given an string.

  #### Parameters

  - ##### comboStr: string

  #### Returns KeyCombo

### getNonSkipKeys

- getNonSkipKeys(keyArr: number[], skipKeys: ISkipKey[]): Array<number>

- - Defined in key-combo.ts:107

  #### Parameters

  - ##### keyArr: number[]

  - ##### skipKeys: ISkipKey[]

  #### Returns Array<number>

### getSkipKeys

- getSkipKeys(keyArr: number[], skipKeys: ISkipKey[]): Array<ISkipKey>

- - Defined in key-combo.ts:103

  #### Parameters

  - ##### keyArr: number[]

  - ##### skipKeys: ISkipKey[]

  #### Returns Array<ISkipKey>

### isEqual

- isEqual(currentCombo: KeyCombo, targetCombo: KeyCombo): boolean

- - Defined in key-combo.ts:56

  #### Parameters

  - ##### currentCombo: KeyCombo

  - ##### targetCombo: KeyCombo

  #### Returns boolean

### isSkipKey

- isSkipKey(key: number, skipKeys: ISkipKey[]): boolean

- - Defined in key-combo.ts:111

  #### Parameters

  - ##### key: number

  - ##### skipKeys: ISkipKey[]

  #### Returns boolean

### parse

- parse(comboStr: string): IComboSplit

- - Defined in key-combo.ts:66

  Parses the string and gets the code or codes of it

  #### Parameters

  - ##### comboStr: string

  #### Returns IComboSplit

### splitCombo

- splitCombo(combo: TComboSanitized): IComboSplit

- - Defined in key-combo.ts:78

  Return a split combo with keys and stateKeys

  #### Parameters

  - ##### combo: TComboSanitized

  #### Returns IComboSplit

Generated using TypeDoc