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


Groups > comp.lang.javascript > #14595 > unrolled thread

keycode

Started by"Phil Hunt" <aaa@aaa.com>
First post2012-06-21 09:54 -0400
Last post2012-06-21 20:08 +0200
Articles 10 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  keycode "Phil Hunt" <aaa@aaa.com> - 2012-06-21 09:54 -0400
    Re: keycode "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-21 14:08 +0000
      Re: keycode "Phil Hunt" <aaa@aaa.com> - 2012-06-21 10:25 -0400
        Re: keycode "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-21 14:50 +0000
          Re: keycode "Phil Hunt" <aaa@aaa.com> - 2012-06-21 11:00 -0400
            Re: keycode "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-21 16:30 +0000
            Re: keycode Arno Welzel <usenet@arnowelzel.de> - 2012-06-27 17:31 +0200
        Re: keycode Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-06-21 18:28 +0200
          Re: keycode "Phil Hunt" <aaa@aaa.com> - 2012-06-21 13:00 -0400
            Re: keycode Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-06-21 20:08 +0200

#14595 — keycode

From"Phil Hunt" <aaa@aaa.com>
Date2012-06-21 09:54 -0400
Subjectkeycode
Message-ID<jrv9ht$d3e$1@speranza.aioe.org>
I need some help to find out what key was pressed or down on a webpage 
textbox.

Thanks 

[toc] | [next] | [standalone]


#14596

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-06-21 14:08 +0000
Message-ID<XnsA079A4362D14Ceejj99@194.109.133.133>
In reply to#14595
Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:

> I need some help to find out what key was pressed or down on a webpage 
> textbox.

<https://www.google.com/search?q=javascript+keycode>

About 1,330,000 results

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#14597

From"Phil Hunt" <aaa@aaa.com>
Date2012-06-21 10:25 -0400
Message-ID<jrvbc0$i8k$1@speranza.aioe.org>
In reply to#14596
I did google it.
And I found 1 out of 1 million what works.

Thanks. Case closed


"Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote in message 
news:XnsA079A4362D14Ceejj99@194.109.133.133...
> Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:
>
>> I need some help to find out what key was pressed or down on a webpage
>> textbox.
>
> <https://www.google.com/search?q=javascript+keycode>
>
> About 1,330,000 results
>
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress) 

[toc] | [prev] | [next] | [standalone]


#14598

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-06-21 14:50 +0000
Message-ID<XnsA079AB4B2E271eejj99@194.109.133.133>
In reply to#14597
Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:

> "Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote in message 
> news:XnsA079A4362D14Ceejj99@194.109.133.133...
>> Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:
>>
>>> I need some help to find out what key was pressed or down on a webpage
>>> textbox.
>>
>> <https://www.google.com/search?q=javascript+keycode>
>>
>> About 1,330,000 results

[please do not toppost on usenet.]

> I did google it.
> And I found 1 out of 1 million what works.

How would you know, dit you test them all?

At least you have learned to use Google.

Did you learn something about javascript and usenet practice?
 
> Thanks. Case closed

You, the OP, do not have ownership of a discussion on usenet,
you cannot close what you started here. 

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#14599

From"Phil Hunt" <aaa@aaa.com>
Date2012-06-21 11:00 -0400
Message-ID<jrvddf$nvo$1@speranza.aioe.org>
In reply to#14598
'case closed' means people don't have to spend more time with it.





"Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote in message 
news:XnsA079AB4B2E271eejj99@194.109.133.133...
> Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:
>
>> "Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote in message
>> news:XnsA079A4362D14Ceejj99@194.109.133.133...
>>> Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:
>>>
>>>> I need some help to find out what key was pressed or down on a webpage
>>>> textbox.
>>>
>>> <https://www.google.com/search?q=javascript+keycode>
>>>
>>> About 1,330,000 results
>
> [please do not toppost on usenet.]
>
>> I did google it.
>> And I found 1 out of 1 million what works.
>
> How would you know, dit you test them all?
>
> At least you have learned to use Google.
>
> Did you learn something about javascript and usenet practice?
>
>> Thanks. Case closed
>
> You, the OP, do not have ownership of a discussion on usenet,
> you cannot close what you started here.
>
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress) 

[toc] | [prev] | [next] | [standalone]


#14601

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-06-21 16:30 +0000
Message-ID<XnsA079BC570EB12eejj99@194.109.133.133>
In reply to#14599
Phil Hunt wrote on 21 jun 2012 in comp.lang.javascript:

> 'case closed' means people don't have to spend more time with it.

Usenet is not a paid helpdesk, we [the people?] don't have to do anything.

Suggestion:
"Terribly sorry, folks, that I forgot to look it up on Google first,
I feel my question is answered with what I found."


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#14712

FromArno Welzel <usenet@arnowelzel.de>
Date2012-06-27 17:31 +0200
Message-ID<4FEB2744.2010307@arnowelzel.de>
In reply to#14599
Phil Hunt, 21.06.2012 17:00:

> 'case closed' means people don't have to spend more time with it.

Ahem... this is not a free helpdesk where people just wait to answer
questions.

At least you could post the solution, you use since other people took
their private time to read your question. And maybe others will also
find this helpful.

And BTW: If you don't want to receive e-mail, please use
<invalid@invalid.invalid> and not <aaa@aaa.com>, since aaa.com is an
*existing* domain (the American Automobile Association, Inc.) and all
spam goes there now, after you have used their domain for your posting :-(


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

[toc] | [prev] | [next] | [standalone]


#14600

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-06-21 18:28 +0200
Message-ID<1598379.oMNUckLgyt@PointedEars.de>
In reply to#14597
Phil Hunt wrote:

> I did google it.

Using which keywords?

> And I found 1 out of 1 million what works.

Given that you had to search for this rather basic DOM knowledge, how can 
you be so sure now that it works, or be sure about the numbers?  With how 
many keyboards in how many browser versions on how many OSes on how many 
platforms have you tested this supposed solution?

Because of the differences in DOM implementations, handling keyboard events 
properly ranges among the most difficult tasks in DOM programming.  See for 
example

<http://unixpapa.com/js/key.html>
<http://brain4.de/programmierecke/js/tastatur.php#start>

And it is considered good style to present the solution that one has found 
by oneself to the community to make up for the free time of others, and for 
others to learn from it.  It is also considered good style on Usenet to not 
top-post.

<http://jibbering.com/faq/#posting>


PointedEars
-- 
Sometimes, what you learn is wrong. If those wrong ideas are close to the 
root of the knowledge tree you build on a particular subject, pruning the 
bad branches can sometimes cause the whole tree to collapse.
  -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>

[toc] | [prev] | [next] | [standalone]


#14602

From"Phil Hunt" <aaa@aaa.com>
Date2012-06-21 13:00 -0400
Message-ID<jrvkel$b8t$1@speranza.aioe.org>
In reply to#14600
 "basic DOM knowledge" and then "most difficult tasks in DOM programming" 
???
Which one is it ? That's why I come here after google shows me so many dead 
end.

I mostly pretend to do .net asp, but I just need this jscript this time

I google with 'event.keycode' to come up with

{
if(window.event) // IE8 and earlier
 {
 keynum = e.keyCode;
 }
else if(e.which) // IE9/Firefox/Chrome/Opera/Safari
 {
 keynum = e.which;
 }

It works, that's all I know



"Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote in message 
news:1598379.oMNUckLgyt@PointedEars.de...
> Phil Hunt wrote:
>
>> I did google it.
>
> Using which keywords?
>
>> And I found 1 out of 1 million what works.
>
> Given that you had to search for this rather basic DOM knowledge, how can
> you be so sure now that it works, or be sure about the numbers?  With how
> many keyboards in how many browser versions on how many OSes on how many
> platforms have you tested this supposed solution?
>
> Because of the differences in DOM implementations, handling keyboard 
> events
> properly ranges among the most difficult tasks in DOM programming.  See 
> for
> example
>
> <http://unixpapa.com/js/key.html>
> <http://brain4.de/programmierecke/js/tastatur.php#start>
>
> And it is considered good style to present the solution that one has found
> by oneself to the community to make up for the free time of others, and 
> for
> others to learn from it.  It is also considered good style on Usenet to 
> not
> top-post.
>
> <http://jibbering.com/faq/#posting>
>
>
> PointedEars
> -- 
> Sometimes, what you learn is wrong. If those wrong ideas are close to the
> root of the knowledge tree you build on a particular subject, pruning the
> bad branches can sometimes cause the whole tree to collapse.
>  -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39> 

[toc] | [prev] | [next] | [standalone]


#14603

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-06-21 20:08 +0200
Message-ID<9717015.O9o76ZdvQC@PointedEars.de>
In reply to#14602
Phil Hunt wrote:

>  "basic DOM knowledge" and then "most difficult tasks in DOM programming"
> ???
> Which one is it ?

Both.  Keyboard events are part of basic DOM knowledge indeed, but it is 
very difficult to make use of them because there are so many different 
implementations.

> I mostly pretend to do .net asp, but I just need this jscript this time
                                                        ^^^^^^^
You should have said so from the start.  Microsoft's implementation of 
ECMAScript is called JScript, BTW (although at least in the MSDN Library 
they have jumped the "JavaScript" meme bandwagon recently), and it has 
little to do with the DOM implementation you are programming for, the MSHTML 
DOM.  But from your code it looks as if that was not the end of it.

> I google with 'event.keycode' to come up with
> 
> {
> if(window.event) // IE8 and earlier
>  {
>  keynum = e.keyCode;
>  }
> else if(e.which) // IE9/Firefox/Chrome/Opera/Safari

Ouch.  Attributing different DOM behavior to different browsers (instead of 
different DOMs) – this is where misconceptions begin in this field.

>  {
>  keynum = e.which;
>  }

This code could use a bit of Pretty Printing.
 
> It works, that's all I know

It works for some keys, but not others, to begin with.  See the references
I have provided.

> "Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote in message
> news:1598379.oMNUckLgyt@PointedEars.de...
>> […]

Would you *please* stop top-posting?  And please fix your From header field 
and skip the attribution novel while you are at it.  <http://insideoe.com/>


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web