[thelist] Javascript keyboard events

Lucian Slatineanu lucian.slatineanu at gmail.com
Wed Dec 28 11:20:22 CST 2005


Hi,

I need to identify the keys pressed within an 'onkeypress' event. I've
read PPK's awsome event accessing tutorial but I need something a bit
different.

In the tutorial, the function is called like this:

element.onkeypress = doSomething;
function doSomething(e) {}

where 'e' can access the event type.

However, I need to feed some more parameters to my function, so it
goes something like this:
stuff[q].onkeypress = new Function('doSomething('+q+')');

Is there anyway I can still access the event type like this? What I
need to do is find out what key was pressed (like Tab) and act
accordingly.

Thanks,
Lucian



More information about the thelist mailing list