keypress() not working in IE8

keypress() not working in IE8

I am making a typing speed test and I am having trouble with IE8 ( I have only tested in Chrome v34.0 and IE8 so far.) In IE8 the keypress is coming back as undefined.

I have this inside of a $(function() { 




        var lastLetter;

$('#typedTextBox').focus().keypress(function() {
if (errorTest === "hasn't started yet") {
errorTest = 'running';
run = setInterval(count, 1000);
}
//STOP ERRORS FROM PEOPLE HITTING SPACE BAR TWICE IN A ROW  !!NOT WORKING IN IE8
var thisLetter = event.which;
if (lastLetter === 32 && event.which === 32) {
event.preventDefault();
}
lastLetter = thisLetter;

}).keyup(function() {
//STOP ERRORS FROM BACKSPACE NOT REGISTERING WITH KEYPRESS FUNCTION
if (event.which === 8) {
lastLetter = 8;
}