i've been trying to capture document level key press events in a webpage but
$(document).bind('keydown', 'a', keyevent_cb);
fails to respond consistently in firefox. works great in IE (which is kind of a trip). any recommendations? i've attempted other solutions without jquery and they also fail for firefox.
so i'm open to any result that works consistently (jquery or not). thanks in advance.
The following attaches a keypress event listener to the body element:
With your
keyevent_cb
callback, you could simply do: