# FKeyBind.KeyTracker

`com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker`

Tracks key names marked pressed by JsMacros key and keybind state calls; it does not query
 physical keyboard state. Direct calls update only this ledger and do not synthesize input.  
 ```js
Chat.log(ScriptClasses.KeyTracker.getPressedKeys());  
 ```

Available in scripts as `ScriptClasses.KeyTracker`.

Nested type declared in [KeyBind](FKeyBind.md); not a separate global library.

## Constructors

### new FKeyBind.KeyTracker {#com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker_constructor-}

```js
new FKeyBind.KeyTracker()
```

## Methods

### getPressedKeys {#com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker_getPressedKeys-}

```js
static getPressedKeys(): Set<String>
```

Returns an immutable snapshot of tracked pressed key names.

**Returns:** immutable snapshot of tracked pressed key names

### press {#com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker_press-InputConstants.Key-}

```js
static press(InputConstants.Key key): void
```

Records the raw key's name in the tracked pressed-name set. A null name is ignored.

**Parameters:**
- `key`: the raw key whose name to record

### press {#com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker_press-KeyMapping-}

```js
static press(KeyMapping bind): void
```

Records the key mapping's current serialized key name in the tracked pressed-name set. A null name is ignored.

**Parameters:**
- `bind`: the key mapping whose current assigned key name to record

### unpress {#com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker_unpress-InputConstants.Key-}

```js
static unpress(InputConstants.Key key): void
```

Removes the raw key's name from the tracked pressed-name set. A null name is ignored.

**Parameters:**
- `key`: the raw key whose name to remove

### unpress {#com.jsmacrosce.jsmacros.client.api.library.impl.FKeyBind.KeyTracker_unpress-KeyMapping-}

```js
static unpress(KeyMapping bind): void
```

Removes the key mapping's current serialized key name from the tracked pressed-name set. A null name is ignored.

**Parameters:**
- `bind`: the key mapping whose current assigned key name to remove
