KeyTracker

class KeyTracker(keyEvents: KeyEvents)(source)

Tracks the keys currently pressed on the keyboard.

This class listens to key down and key up events from a provided KeyEvents instance and maintains a set of the currently pressed keys. Keys are identified by their names.

Parameters

keyEvents

The source of the key events to listen to.

Constructors

Link copied to clipboard
constructor(keyEvents: KeyEvents)

Creates a new KeyTracker instance by subscribing to the provided KeyEvents object.

Properties

Link copied to clipboard

A read-only set containing the names of the keys currently pressed on the keyboard.