Here is a test page for it:
I suspect the problem may be where you are attaching your event handler... at the document level. Events "bubble" up the DOM tree, so by the time your KeyCheck method is being called, the event handler at the INPUT element has already completed (including the default action). I suspect that if you attached this to the onkeyup event handler of your INPUT element instead of the document, then it might do what you expect.
Thank you for your reply, in the meanwhile I managed to solve my problem. You are right, it was the event handler, but I didn't bind it to the onkeyup of the INPUT, I called keydown on the INPUT and did preventDefault() there just for the 2 keys. Works great now.