window.addEventListener('keydown', function(event) {
  ChromeSamples.log('KeyboardEvent.code:', event.code);
});

window.addEventListener('keydown', function(event) {
  if ('code' in event) {
    ChromeSamples.log('KeyboardEvent.code:', event.code);
  } else {
    ChromeSamples.setStatus('KeyboardEvent.code is not supported.');
  }
});

Check to see if KeyboardEvent.code is supported
Check to see if KeyboardEvent.code is supported