www.webdeveloper.com
Results 1 to 2 of 2

Thread: Detecting Non-Character Key Strokes

  1. #1
    Join Date
    Dec 2005
    Posts
    2,984

    Detecting Non-Character Key Strokes

    I want to determine if a keystroke in a textbox was a character (a, X 3, &, etc) or not (SHIFT, CAPS, PrtScrn).....I am using String.fromCharCode(e.keyCode) for other things and I tried using it here in different ways (because these special keys always return a blank value with a string length of 1, but not a space??) but I can't get it at all.....experts?
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  2. #2
    Join Date
    Feb 2006
    Posts
    2,927
    Catch the keypress event- keyup and down return a keyCode for any key, keypress only returns values for printable keys-

    keyCode in IE before version 9, charCode in the others

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles