KeyCanceller: keep track of keys that have been cancelled in the keydown handler (which takes care of dispatching ex commands) and also cancel them in keypress/keyup event handlers. This fixes https://github.com/tridactyl/tridactyl/issues/234.

If you make modifications to this class, keep in mind that keyup events might not arrive in the same order as the keydown events (e.g. user presses A, then B, releases B and then A).

Hierarchy

  • KeyCanceller

Index

Constructors

constructor

Properties

Private keyPress

keyPress: KeyboardEvent[] = []

Private keyUp

keyUp: KeyboardEvent[] = []

Methods

Private cancelKey

  • cancelKey(ke: KeyboardEvent, kes: KeyboardEvent[]): void

cancelKeyPress

  • cancelKeyPress(ke: KeyboardEvent): void

cancelKeyUp

  • cancelKeyUp(ke: KeyboardEvent): void

push

  • push(ke: KeyboardEvent): void