Results 1 to 2 of 2

Thread: Key Press

  1. #1

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Question Key Press

    How can I trap which key is being pressed on a document.
    I can get it to display a message when a key has been pressed, but I need to trap just certain keys using Javascript.

    Help!!
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  2. #2
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    I'm pretty sure this is IE, not sure about Netscape...
    Code:
    <script LANGUAGE = "JavaScript">
    function showKey(){
    alert(event.keyCode);
    }
    
    document.onkeypress = showKey;
    
    </script>
    Just hit the key you want to find out the keycode...
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width