core.js
// update keys object when a keydown event is detected
update keys object when a keydown event is detected
update keys object when a keydown event is detected
function updateKeys() {
  keys.key = event.key
  keys.time = performance.now() 
  keys.rt = 0
  console.log("key: " + keys.key)
  if (keys.key === 'ArrowRight') {
    showNextTrial()
  }
  if (keys.key === 'r') {
    repeatCurrentTrial()
  }
  if (keys.key === 'ArrowLeft') {
    showPreviousTrial()
  }
  return keys.time
}
function updateKeys ( ) { keys . key = event . key keys . time = performance . now ( ) keys . rt = 0 console . log ( "key: " + keys . key ) if ( keys . key === 'ArrowRight' ) { showNextTrial ( ) } if ( keys . key === 'r' ) { repeatCurrentTrial ( ) } if ( keys . key === 'ArrowLeft' ) { showPreviousTrial ( ) } return keys . time }
update keys object when a keydown event is detected
update keys object when a keydown event is detected
// gets called from: document.addEventListener('keydown', updateKeys); // gives ms