Capturing Keys - Part I<html> <head> <script language="JavaScript1.2"> function keyPressed(evt) { var F2 = 113; if (evt.which == F2) { var strMessage = "Hello, there. I will help you"; strMessage += " in understanding various parts of this page."; var strWindowProperties = "toolbar=no,location=no,status=no,"; strWindowProperties += "menubar=no,scrollbars=no,resizable=yes,"; strWindowProperties += "width=160,height=20"; var win = window.open (win, 'window', strWindowProperties); win.document.write (strMessage); } } window.captureEvents (Event.KEYDOWN); window.onkeydown=keyPressed; </script> </head> <body> Note: JavaScript (for Netscape) is case sensitive.
We have yet to see a single function that works for both Netscape and Internet Explorer. Leave it for the next week. See ya.
The copyright of the article Capturing Keys - Part I in JavaScript is owned by Muhammad Ali Shah. Permission to republish Capturing Keys - Part I in print or online must be granted by the author in writing.
Go To Page: 1 2 Articles in this Topic Discussions in this Topic |