You need to name the handler function in order to reference it later when removing the listener:
lb.addEventListener('keyup',
function keyup(event){ // assigns the handler to "keyup"
keyPress(event.keyCode)
}, false);
document.body.removeEventListener('keyup', keyup, false);