shell.js
function handleKeyDown(shell, ev) {
  if(!isFocused(shell)) {
    return
  }
  handleEvent(shell, ev)
  if(ev.metaKey) {
    //Hack: Clear key state when meta gets pressed to prevent keys sticking
    handleBlur(shell, ev)
  } else {
    var kc = physicalKeyCode(ev.keyCode || ev.char || ev.which || ev.charCode)
    if(kc >= 0) {
      setKeyState(shell, kc, true)
    }
  }
}
function handleKeyDown(shell, ev) {
  if(!isFocused(shell)) {
    return
  }
  handleEvent(shell, ev)
  if(ev.metaKey) {
    //Hack: Clear key state when meta gets pressed to prevent keys sticking
    handleBlur(shell, ev)
  } else {
    var kc = physicalKeyCode(ev.keyCode || ev.char || ev.which || ev.charCode)
    if(kc >= 0) {
      setKeyState(shell, kc, true)
    }
  }
}
function handleKeyDown ( shell , ev ) { if ( ! isFocused ( shell ) ) { return } handleEvent ( shell , ev ) if ( ev . metaKey ) { //Hack: Clear key state when meta gets pressed to prevent keys sticking handleBlur ( shell , ev ) } else { var kc = physicalKeyCode ( ev . keyCode || ev . char || ev . which || ev . charCode ) if ( kc >= 0 ) { setKeyState ( shell , kc , true ) } } }
Set key down
Set key down