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


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

Javascript keycodes

Started byjonas.thornvall@gmail.com
First post2017-10-26 02:09 -0700
Last post2017-10-26 11:36 -0500
Articles 14 — 4 participants

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


Contents

  Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 02:09 -0700
    Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 02:16 -0700
      Re: Javascript keycodes Maik Koenig <usenetspam@maikkoenig.de> - 2017-10-26 12:21 +0200
        Re: Javascript keycodes "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-26 12:30 +0200
          Re: Javascript keycodes Maik Koenig <usenetspam@maikkoenig.de> - 2017-10-26 12:52 +0200
    Re: Javascript keycodes "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-26 12:12 +0200
      Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 06:15 -0700
      Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 06:19 -0700
      Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 06:25 -0700
      Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 06:28 -0700
        Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 06:45 -0700
          Re: Javascript keycodes jonas.thornvall@gmail.com - 2017-10-26 06:54 -0700
            Re: Javascript keycodes "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-10-26 18:30 +0200
    Re: Javascript keycodes Mark Lloyd <not@mail.invalid> - 2017-10-26 11:36 -0500

#34199 — Javascript keycodes

Fromjonas.thornvall@gmail.com
Date2017-10-26 02:09 -0700
SubjectJavascript keycodes
Message-ID<12e04131-18f7-4bef-b57f-646fc4328873@googlegroups.com>
Is there a reason javascript do not differentiate upper and lower keys?
It seem a no brainer it should?
But maybe there is a reason?

[toc] | [next] | [standalone]


#34200

Fromjonas.thornvall@gmail.com
Date2017-10-26 02:16 -0700
Message-ID<9884fb32-d75a-4226-bca9-a55dd11e9c0b@googlegroups.com>
In reply to#34199
Den torsdag 26 oktober 2017 kl. 11:09:30 UTC+2 skrev jonas.t...@gmail.com:
> Is there a reason javascript do not differentiate upper and lower keys?
> It seem a no brainer it should?
> But maybe there is a reason?

To be honest i do not even get how it manage to get the wrong keycode, the keyboard must send one keyboard and javascript keycode method/function convert it into another?

Why would someone do that?

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


#34202

FromMaik Koenig <usenetspam@maikkoenig.de>
Date2017-10-26 12:21 +0200
Message-ID<ossjvh.3uc.1@mid.maikkoenig.de>
In reply to#34200
Am 26.10.2017 um 11:16 schrieb jonas.thornvall@gmail.com:
> Den torsdag 26 oktober 2017 kl. 11:09:30 UTC+2 skrev
> jonas.t...@gmail.com:
>> Is there a reason javascript do not differentiate upper and lower
>> keys? It seem a no brainer it should? But maybe there is a reason?
> 
> To be honest i do not even get how it manage to get the wrong
> keycode, 

The keycode is correct. Think about it: Its a *keycode*, not a
"character code". When shift is pressed or capslock active, the keycode
for a or A is allways the same.

You will have to check if shift is pressed too or if capslock is active.

Or you use event.key:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent

Greetz,
MK
-- 
Kopp-Verlag-Gläubige, Religionsdeppen, rechte Vollidioten
 und ähnlicher Bio-Abfall werden ohne Hinweis ignoriert!

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


#34204

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-10-26 12:30 +0200
Message-ID<XnsA81A7F41C3EF7eejj99@194.109.6.166>
In reply to#34202
Maik Koenig <usenetspam@maikkoenig.de> wrote on 26 Oct 2017 in 
comp.lang.javascript:

> Or you use event.key:
> https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent

Perhaps not everyone is invited for such a keyboard-event?

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

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


#34205

FromMaik Koenig <usenetspam@maikkoenig.de>
Date2017-10-26 12:52 +0200
Message-ID<osslr0.65o.1@mid.maikkoenig.de>
In reply to#34204
Am 26.10.2017 um 12:30 schrieb Evertjan.:
> Maik Koenig <usenetspam@maikkoenig.de> wrote on 26 Oct 2017 in 
> comp.lang.javascript:
> 
>> Or you use event.key:
>> https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
> 
> Perhaps not everyone is invited for such a keyboard-event?
> 

Well...

Greetz,
MK
-- 
Kopp-Verlag-Gläubige, Religionsdeppen, rechte Vollidioten
 und ähnlicher Bio-Abfall werden ohne Hinweis ignoriert!

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


#34201

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-10-26 12:12 +0200
Message-ID<XnsA81A7C352D52Deejj99@194.109.6.166>
In reply to#34199
jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:

> Is there a reason javascript do not differentiate upper and lower keys?
> It seem a no brainer it should?
> But maybe there is a reason?

This is called a strawman argument,
as you premisse is wrong.

It is the keyboards that do not differentiate 
between upper- and lower-case.

Dear no brainer, perhaps you ment 'upper and lower keys' as
that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?

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

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


#34206

Fromjonas.thornvall@gmail.com
Date2017-10-26 06:15 -0700
Message-ID<2c3797e6-3b31-4fc7-a6df-3b88ebf29f14@googlegroups.com>
In reply to#34201
Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:
> 
> > Is there a reason javascript do not differentiate upper and lower keys?
> > It seem a no brainer it should?
> > But maybe there is a reason?
> 
> This is called a strawman argument,
> as you premisse is wrong.
> 
> It is the keyboards that do not differentiate 
> between upper- and lower-case.
> 
> Dear no brainer, perhaps you ment 'upper and lower keys' as
> that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Evertjan,  so you say that a keyboard do not send the keys following the ASCII mapping? That was a total surprise to me, did they use to ones because i remember a guy that did program keyboard bios at least i think i remember he said that they were mapped using ASCII codes.
http://www.asciitable.com/
So what system do they use?


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


#34207

Fromjonas.thornvall@gmail.com
Date2017-10-26 06:19 -0700
Message-ID<06adfa5c-f8aa-47c5-bfd7-f6008e50154e@googlegroups.com>
In reply to#34201
Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:
> 
> > Is there a reason javascript do not differentiate upper and lower keys?
> > It seem a no brainer it should?
> > But maybe there is a reason?
> 
> This is called a strawman argument,
> as you premisse is wrong.
> 
> It is the keyboards that do not differentiate 
> between upper- and lower-case.
> 
> Dear no brainer, perhaps you ment 'upper and lower keys' as
> that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Well Evertjan i am just surprised that computers do not look for small and big chars, i am well aware that the mapping table is font dependent but at least i thought the keyboard sent 7 or 8-bits for each character pressed?

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


#34208

Fromjonas.thornvall@gmail.com
Date2017-10-26 06:25 -0700
Message-ID<ae3973f9-2462-4c9e-a17a-8fb95edd8c11@googlegroups.com>
In reply to#34201
Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:
> 
> > Is there a reason javascript do not differentiate upper and lower keys?
> > It seem a no brainer it should?
> > But maybe there is a reason?
> 
> This is called a strawman argument,
> as you premisse is wrong.
> 
> It is the keyboards that do not differentiate 
> between upper- and lower-case.
> 
> Dear no brainer, perhaps you ment 'upper and lower keys' as
> that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

So does keycode 097-127 exist?
If so where can i find a table over the mappings.

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


#34209

Fromjonas.thornvall@gmail.com
Date2017-10-26 06:28 -0700
Message-ID<1194b5e9-5a31-47f5-ab0d-c6f3c1d4dc20@googlegroups.com>
In reply to#34201
Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:
> 
> > Is there a reason javascript do not differentiate upper and lower keys?
> > It seem a no brainer it should?
> > But maybe there is a reason?
> 
> This is called a strawman argument,
> as you premisse is wrong.
> 
> It is the keyboards that do not differentiate 
> between upper- and lower-case.
> 
> Dear no brainer, perhaps you ment 'upper and lower keys' as
> that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

I may be a bit dent but i thought the keyboard always worked with ASCII and that the computerside then depending upon language selected a unicode table to map the ASCII ?

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


#34210

Fromjonas.thornvall@gmail.com
Date2017-10-26 06:45 -0700
Message-ID<ed27dc79-860c-47b9-9399-e2d05882cdc0@googlegroups.com>
In reply to#34209
Den torsdag 26 oktober 2017 kl. 15:28:09 UTC+2 skrev jonas.t...@gmail.com:
> Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
> > jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:
> > 
> > > Is there a reason javascript do not differentiate upper and lower keys?
> > > It seem a no brainer it should?
> > > But maybe there is a reason?
> > 
> > This is called a strawman argument,
> > as you premisse is wrong.
> > 
> > It is the keyboards that do not differentiate 
> > between upper- and lower-case.
> > 
> > Dear no brainer, perhaps you ment 'upper and lower keys' as
> > that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
> > 
> > -- 
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
> 
> I may be a bit dent but i thought the keyboard always worked with ASCII and that the computerside then depending upon language selected a unicode table to map the ASCII ?

Evidently they have some special mapping for USB HID components, but i have a computer with PS2, how does that work? It can't be analog or?

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


#34211

Fromjonas.thornvall@gmail.com
Date2017-10-26 06:54 -0700
Message-ID<2b8f8b3f-9531-4493-889f-1f9b0c7b2341@googlegroups.com>
In reply to#34210
Den torsdag 26 oktober 2017 kl. 15:45:14 UTC+2 skrev jonas.t...@gmail.com:
> Den torsdag 26 oktober 2017 kl. 15:28:09 UTC+2 skrev jonas.t...@gmail.com:
> > Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
> > > jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:
> > > 
> > > > Is there a reason javascript do not differentiate upper and lower keys?
> > > > It seem a no brainer it should?
> > > > But maybe there is a reason?
> > > 
> > > This is called a strawman argument,
> > > as you premisse is wrong.
> > > 
> > > It is the keyboards that do not differentiate 
> > > between upper- and lower-case.
> > > 
> > > Dear no brainer, perhaps you ment 'upper and lower keys' as
> > > that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
> > > 
> > > -- 
> > > Evertjan.
> > > The Netherlands.
> > > (Please change the x'es to dots in my emailaddress)
> > 
> > I may be a bit dent but i thought the keyboard always worked with ASCII and that the computerside then depending upon language selected a unicode table to map the ASCII ?
> 
> Evidently they have some special mapping for USB HID components, but i have a computer with PS2, how does that work? It can't be analog or?

Well i see now it is called scancodes sent

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


#34212

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-10-26 18:30 +0200
Message-ID<XnsA81ABC5599E1Deejj99@194.109.6.166>
In reply to#34211
jonas.thornvall@gmail.com wrote on 26 Oct 2017 in comp.lang.javascript:

> Den torsdag 26 oktober 2017 kl. 15:45:14 UTC+2 skrev
> jonas.t...@gmail.com: 
>> Den torsdag 26 oktober 2017 kl. 15:28:09 UTC+2 skrev
>> jonas.t...@gmail.com: 
>> > Den torsdag 26 oktober 2017 kl. 12:12:40 UTC+2 skrev Evertjan.:
>> > > jonas.thornvall@gmail.com wrote on 26 Oct 2017 in
>> > > comp.lang.javascript: 
>> > > 
>> > > > Is there a reason javascript do not differentiate upper and lower
>> > > > keys? It seem a no brainer it should?
>> > > > But maybe there is a reason?
>> > > 
>> > > This is called a strawman argument,
>> > > as you premisse is wrong.
>> > > 
>> > > It is the keyboards that do not differentiate 
>> > > between upper- and lower-case.
>> > > 
>> > > Dear no brainer, perhaps you ment 'upper and lower keys' as
>> > > that a 'Q' is 'upper' to an 'A' on an US-qwerty keyboard?
>> > > 
>> > > -- 
>> > > Evertjan.
>> > > The Netherlands.
>> > > (Please change the x'es to dots in my emailaddress)
>> > 
>> > I may be a bit dent but i thought the keyboard always worked with
>> > ASCII and that the computerside then depending upon language selected
>> > a unicode table to map the ASCII ? 
>> 
>> Evidently they have some special mapping for USB HID components, but i
>> have a computer with PS2, how does that work? It can't be analog or? 
> 
> Well i see now it is called scancodes sent

It does not matter what it is called, but how it works.

The keyboard does not know or process what is printet on top of the physical 
keys, it just forwads the action and the state of the key to the computer,
and the driver in the computer assumes what is ment by that.

So a French keyboard driver assumes an a/A where a US keyboard driver 
assumes a q/Q, and a Hebrew keyboard driver assumes a "/", or a lower!!-case 
'q' when the shift is pressed.

Electromechanically they are all one and the same keyboard but the print on 
the key-top, and that print should match the keyboard-driver.

There is or should be no difference between a PS2 and a USB interface,
because that is just the interface-method.


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

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


#34213

FromMark Lloyd <not@mail.invalid>
Date2017-10-26 11:36 -0500
Message-ID<vaoIB.32717$E_2.19938@fx41.iad>
In reply to#34199
On 10/26/2017 04:09 AM, jonas.thornvall@gmail.com wrote:
> Is there a reason javascript do not differentiate upper and lower keys?
> It seem a no brainer it should?
> But maybe there is a reason?
> 

Are you referring to the "keydown" and "keyup" events? The keycode is 
telling you which KEY is being pressed. You use the 'shiftKey' property 
to find out if shift is pressed also.

-- 
60 days until the winter celebration (Monday December 25, 2017 12:00:00
AM for 1 day).

Mark Lloyd
http://notstupid.us/

"He who hears this name [God] from a Jew must inform the authorities, or
else throw sow dung at him when he sees him and chase him away." [Martin
Luther,"On the Jews and Their Lies",1543]

[toc] | [prev] | [standalone]


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


csiph-web