Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #12740

Re: onkeydown and onkeyup

From "J.R." <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: onkeydown and onkeyup
Date 2012-03-14 23:53 -0300
Organization Aioe.org NNTP Server
Message-ID <jjrlj7$di9$1@speranza.aioe.org> (permalink)
References <fva0m7pct2kfuppli6otfhu6emoeqs6sd2@4ax.com>

Show all headers | View raw


On 14/03/2012 02:35, Gene Wirchenko wrote:
> Dear JavaScripters:
>
>       I am working on a proof-of-concept for date entry (as noted in
> the thread "Fancy Date Entry").
>
>    1) Using just onkeydown or just onkeyup, I have the problem that
> backspace is echoed despite my returning false from the event
> handling.  If I just return false from the onkeydown handling and
> process in the onkeyup handling including return false, then the
> backspace is not echoed.
>

   *  It seems to be useless to filter tab or enter keys in an input 
element using any of the onkey* events. You may succeed in Firefox but 
not in IE.
   *  onkeyup/down events are the only case in which all modern browsers 
return the key code.
   *  onkeydown/onkeypress can be cancelled whereas onkeup cannot (see 
MSDN and MDN for documentation)
   *  To retrieve the charCode, use the onkeypress event in IE/Opera - 
other browsers will do (see http://www.quirksmode.org/js/keys.html)

>       So I have something that works, but I would like to know why it
> is that way.
>
>    2) I also need to figure out what cursor control keys I need to deal
> with.<left arrow>  returns 37 for its value.  That is the same as
> percent.  Obviously, I am missing a bit here that I need to figure
> out.
>

some key codes: 8 = backspace; 9 = tab; 13 = carriage return (enter
                 or shift enter); 32 = space; 37 = left arrow; 38 = up
                 arrow; 39 = right arrow; 40 = down arrow.

-- 
Joao Rodrigues (J.R.)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-13 22:35 -0700
  Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 22:40 -0700
  Re: onkeydown and onkeyup Norman Peelman <npeelmandog@cfl.rr.com> - 2012-03-14 17:59 -0400
    Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 15:10 -0700
      Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-14 17:57 -0700
        Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 19:39 -0700
  Re: onkeydown and onkeyup "J.R." <groups_jr-1@yahoo.com.br> - 2012-03-14 23:53 -0300
    Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 20:26 -0700
    Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-14 22:13 -0700
      Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 22:40 -0700
        Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-15 08:25 -0700
          Re: onkeydown and onkeyup "J.R." <groups_jr-1@yahoo.com.br> - 2012-03-18 13:07 -0300
            Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-19 00:05 -0700
          Re: onkeydown and onkeyup "Mel Smith" <med_cutout_syntel@aol.com> - 2012-03-19 09:54 -0700
            Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-19 12:37 -0700
              Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-19 20:53 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-19 16:20 -0700
                Re: onkeydown and onkeyup Jeff North <jnorthau@yahoo.com.au> - 2012-03-20 12:12 +1100
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-19 18:45 -0700
                Re: onkeydown and onkeyup Jeff North <jnorthau@yahoo.com.au> - 2012-03-20 17:17 +1100
                Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-20 16:37 -0700
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-20 19:25 -0700
                Re: onkeydown and onkeyup Dr J R Stockton <reply1212@merlyn.demon.co.uk.not.invalid> - 2012-03-21 19:27 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-21 19:19 -0700
                Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-22 16:06 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-22 09:59 -0700
                Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-22 18:10 +0000
                Re: onkeydown and onkeyup Tim Streater <timstreater@greenbee.net> - 2012-03-22 19:19 +0000
                Re: onkeydown and onkeyup Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-03-23 01:44 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-22 12:36 -0700
                Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-23 09:05 +0000
              Re: onkeydown and onkeyup "Mel Smith" <med_cutout_syntel@aol.com> - 2012-03-19 15:49 -0700
      Re: onkeydown and onkeyup Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-03-16 12:59 +1100
        Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-15 21:58 -0700
          Re: onkeydown and onkeyup Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-03-16 18:13 +1100
            Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-16 08:11 -0700
              Re: onkeydown and onkeyup John G Harris <john@nospam.demon.co.uk> - 2012-03-16 16:58 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-16 12:05 -0700
        Re: onkeydown and onkeyup Dr J R Stockton <reply1211@merlyn.demon.co.uk.not.invalid> - 2012-03-17 19:13 +0000
          Re: onkeydown and onkeyup Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-03-18 12:46 +1100
            Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-17 19:13 -0700
            Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-17 23:27 -0700

csiph-web