All files / packages/tools/src/eventListeners/keyboard index.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17      96x 96x       100x                
import keyDownListener, { getModifierKey } from './keyDownListener';
 
function enable(element: HTMLDivElement): void {
  disable(element);
  element.addEventListener('keydown', keyDownListener);
}
 
function disable(element: HTMLDivElement): void {
  element.removeEventListener('keydown', keyDownListener);
}
 
export default {
  enable,
  disable,
  getModifierKey,
};