shell.js
function setKeyState(shell, key, state) {
  var ps = shell._curKeyState[key]
  if(ps !== state) {
    if(state) {
      shell._pressCount[key]++
    } else {
      shell._releaseCount[key]++
    }
    shell._curKeyState[key] = state
  }
}
function setKeyState(shell, key, state) {
  var ps = shell._curKeyState[key]
  if(ps !== state) {
    if(state) {
      shell._pressCount[key]++
    } else {
      shell._releaseCount[key]++
    }
    shell._curKeyState[key] = state
  }
}
function setKeyState ( shell , key , state ) { var ps = shell . _curKeyState [ key ] if ( ps !== state ) { if ( state ) { shell . _pressCount [ key ] ++ } else { shell . _releaseCount [ key ] ++ } shell . _curKeyState [ key ] = state } }
Set key state
Set key state