Class: KeyboardHandler

(private) KeyboardHandler(container, player)

Set up a keyboard event listener to detect chart navigation keypresses.

Constructor

(private) new KeyboardHandler(container, player)

Parameters:
Name Type Description
container HTMLElement - The element (usually a <div>) containing the chart
player Player AudioChart Player object
Source:
To Do:
  • mark up the DIV properly
  • check what sort of element we get given? no; could be button?

Methods

handleLeft()

Handle a left arrow being pressed
Source:

handleRight()

Handle a right arrow being pressed
Source:

handleSpace()

Handle the space key being pressed
Source:

keypressHandler(event)

Handle keypresses Note: This is bound to the KeyboardHandler so that it can call the right handler methods.
Parameters:
Name Type Description
event KeyboardEvent the KeyboardEvent that occured
Source:
To Do:
  • make link work