I have no idea why your code is not working, but it's too complicated - this should do the trick:
document.observe('keydown', myEventHandler);
There is no need to wait load, because it documentis available immediately.
, . Opera , , Firefox, , -, .
, , document, , , DOM document.