function doc_keyUp(event) {
  /* Those key values have been tested on MAC OS */
  const KEY_SPACE = 32;
  const KEY_LEFT = 37;
  const KEY_RIGHT = 39;

  console.log("You pressed", event.keyCode);
  if (event.keyCode == KEY_SPACE) {
    ///
    // SPACE toggle start/pause
    ///
    // We must prevent SPACE default behavior
    // because if we don't SPACE bar will also push on any selected element
    // For example, if START button is selected, you push SPACE then
    // toggleStartPause is called
    // then button is pushed by the event chain and
    // then timer is toggled another time
    event.preventDefault();
    // And at last, toggle the clock
    toggleStartPause();
  } else if (event.keyCode == KEY_LEFT) {
    previousStep();
  } else if (event.keyCode == KEY_RIGHT) {
    nextStep();
  }
}
/**
 * This function is called on a document key_up
 * Code the shortcuts here
 */
This function is called on a document key_up
Code the shortcuts here
This function is called on a document key_up Code the shortcuts here
function doc_keyUp(event) {
  const KEY_SPACE = 32;
  const KEY_LEFT = 37;
  const KEY_RIGHT = 39;
  console.log("You pressed", event.keyCode);
  if (event.keyCode == KEY_SPACE) {
    event.preventDefault();
    toggleStartPause();
  } else if (event.keyCode == KEY_LEFT) {
    previousStep();
  } else if (event.keyCode == KEY_RIGHT) {
    nextStep();
  }
}
function doc_keyUp ( event ) { const KEY_SPACE = 32 ; const KEY_LEFT = 37 ; const KEY_RIGHT = 39 ; console . log ( "You pressed" , event . keyCode ) ; if ( event . keyCode == KEY_SPACE ) { event . preventDefault ( ) ; toggleStartPause ( ) ; } else if ( event . keyCode == KEY_LEFT ) { previousStep ( ) ; } else if ( event . keyCode == KEY_RIGHT ) { nextStep ( ) ; } }
This function is called on a document key_up
 Code the shortcuts here
This function is called on a document key_up Code the shortcuts here
/* Those key values have been tested on MAC OS */ /// // SPACE toggle start/pause /// // We must prevent SPACE default behavior // because if we don't SPACE bar will also push on any selected element // For example, if START button is selected, you push SPACE then // toggleStartPause is called // then button is pushed by the event chain and // then timer is toggled another time // And at last, toggle the clock