Handle Key events

Dimolas Dimitris Outsource S.A. dimolas at outsource.gr
Mon Feb 10 14:49:56 GMT 2003


Dear Sir

 

I have just begun to develop an Internet Application using Konqueror.

The Application (site) is all ready written in VB (Internet Explorer) and we would like to transfer a part of the site in Linux Suse.

So we have changed the script language to JavaScript

The differences are huge as we expect!

So I would like to ask you a very simple question. I want with the key "ENTER" to move the focus to the next control. But the problem I have is how do I get the key Code of the key user pressed???

 

This sample code should catch the key code but nothing happens!

 

Here is the code

document.onkeydown =Dockeydown; 

var isNN4up = (window.Event)? true : false; 

 

function Dockeydown(e) 

{ 

if (isNN4up) 

{ 

var evnt=e; 

var whichKey = e.which; 

} 

else 

{ 

var evnt=window.event ;

var whichKey = window.event.keyCode; 

}

alert(whichKey);

}

 

Could u please help me with this??

Send me a sample code how to get the keyCode

 

Thanks in advance

Please if you may responde as soon as possible
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20030210/bc1e7d80/attachment.htm>


More information about the kfm-devel mailing list