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


Groups > comp.lang.javascript > #31128

Re: Interrogation of Shift-Key state

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Interrogation of Shift-Key state
Date 2016-08-20 11:48 +0200
Organization PointedEars Software (PES)
Message-ID <1834204.MAbN39jv87@PointedEars.de> (permalink)
References (3 earlier) <d052c5aa-94b2-49f9-a493-ea81296acba9@googlegroups.com> <2365735.mvXUDI8C0e@PointedEars.de> <12d9fda2-1369-473e-8415-3739eb04d6a4@googlegroups.com> <4981358.DvuYhMxLoT@PointedEars.de> <da3c74bd-eb1e-457f-9453-8550ecf5717d@googlegroups.com>

Show all headers | View raw


Michael Haufe (TNO) wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Michael Haufe (TNO) wrote:
>> > Thomas 'PointedEars' Lahn wrote:
>> >> Michael Haufe (TNO) wrote:
>> >> > So depending on your platform targets, there is a good chance you're
>> >> > going to be getting some contradictory information in some cases
>> >> > (keydown followed by a keypress and possibly by keyup somewhere in
>> >> > there in repetition)
>> >> Name one.
>> > <https://bugzilla.mozilla.org/show_bug.cgi?id=602812>
>> There is nothing there that corroborates your belief.
> 
> Platforms are listed in there as well as in the original link I posted
> earlier. What exactly are you trying to criticize here?

That you are jumping to conclusions, (unintentionally, I trust) spreading 
FUD.

> You don't believe the events repeat as listed in the original MDN article?

No.  First of all, I am trained in *scientific* thinking, so I am naturally 
skeptic: I do not just believe, I demand *evidence* supporting statements.  
Second, as a result, I *think* that statements made in such a way cannot be 
a solid basis for design decisions.  Third, my *tests* in 
navigator.userAgent === "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) 
Gecko/20100101 Firefox/38.0 Iceweasel/38.1.0" (note the Gecko version), 
using the test code I posted, do not confirm the statements: in all 
instances, there is only one “keyup” event for such keys.

> Or you don't like that I generalized the MDN link to include the Shift key
> in the list of non-character items?

Once again, this is not personal; it does not matter whether *I* *like* it.
It was *fallacious*.

You have claimed “a good chance” that what you describe is going to happen.
Evidently it is not such, not even remotely.
 
> If you're criticizing the first, that's hard to believe.

How so?  It is a wiki, not reference material written solely by Mozilla.org 
developers or developers working for the Mozilla Corporation.  It is peer-
reviewed, (which is good; although not on a regular basis, AFAIK, which is 
not so good) but until that happened, anyone could have written any nonsense 
there.

As you can see, I am using a rather old Firefox on GNU/Linux (due to 
distribution limitations: I do not want systemd running on my computers) in 
which I cannot confirm those claims.

It is possible that I do not meet the requirements of the (imprecisely 
formulated) observations there: I am using Debian GNU/Linux, not Ubuntu 
(which is Debian-based), so I am using (naturally) the GTK(+) variant of 
Firefox (then rebranded by Debian as “Iceweasel” due to licensing issues, 
but the relevant codebase should be the same), and I am running it from
KDE, not a GNOME-based desktop environment.

However, I find it more likely that the person writing this part of the 
article (which would have been about 7 years ago; the history will tell for 
sure) has encountered the edge-case bug fixed three years ago or earlier,
if that.  (See below.)

> […] I know PPK has discovered inconsistencies in the shift key
> behavior in the past as well [1],
> 
> [1] <http://www.quirksmode.org/dom/events/keys.html>

How far in the past, and how detailed?  You are wrong if you think that 
descriptions like “Shift keys” in “FF 7.0 Win” are detailed enough findings.  
It is curious that you do not realize that as the bug report that you 
referred to shows it.

> so it isn't unreasonable to be conservative in this case in the absence of
> information about specific platform targets.

It is unreasonable in the absence of platform target information if the 
versions in question have met their end-of-life long ago, and the browser 
bugs in that regard, that existed only for a short period of time, have been 
fixed long ago.  For what we now know, it is possible that PPK has tested 
those versions of Firefox, and only those, where the bug described in the 
bug report existed.

Also, PPK does not say anything about “keyup” events repeating when a key is 
held down.  Was his testing insufficient, or is the MDN article section the 
result of superficial testing?  They cannot be both correct unless there 
were edge-case bugs.

>> >> > Which means you are now looking at the keypress event. Luckily, the
>> >> > event that is raised has a property called "shiftKey" which you can
>> >> > interrogate.
>> >> The *proprietary/legacy* “keypress” event is not fired for
>> >> non-character
>> >> keys; never has been.  This is how you can tell apart, for example,
>> >> the right arrow key ({keyCode: 39, charCode: 0}) and the apostrophe
>> >> key ({keyCode: 39, charCode: 39}}; on my laptop with Swiss German
>> >> keyboard layout, YMMV).
>> > 
>> > See the above link
>> 
>> BTDT.  It says that *in Firefox*
> 
> You said it's not fired, and never has been. The link contradicts that
> claim.

Edge-case bugs aside of course.  You make it sound as if this had not been 
an edge-case bug and it would be reasonable to be considered everywhere for 
all eternity.
 
> […] You claimed:
> 
> "The *proprietary/legacy* “keypress” event is not fired for non-character
> keys; never has been."
> 
> Which is evidently not true, but when presented with reference you now no
> longer care? Seems like a bad faith criticism from where I'm sitting.
> 
>> “Currently, neither modifier keys nor dead keys cause keypress event(s).”
>> (AISB)
> 
> That's not what you said before. You've added the qualifier "Currently"
> where earlier you said "never".

I am well aware that the bug report disproves the “never has been” in my 
statement.  However, it does not disprove the argument as it was meant: This 
behavior was not by design, it *was* a *bug*.  It *existed* only on *one* 
browser on *one* platform for a *short* period of time, a considerable time 
ago.  And it did not occur with the key in question.
 
> Can you summarize your criticism(s) into a single paragraph for clarity?

The claim made in MDN, which you are primarily basing your argument on, is 
too vague to begin with.  It is also specious: There never was a 9.4 version 
of Ubuntu.  Ubuntu versions are released semianually, where the major 
version indicates the year, and the *two-digit* minor version indicates the 
month of the release.  There was a Ubuntu _9.04_ (“Jaunty Jackalope”) 
released in 2009-04; it was not a Long Term Support release, so support for 
it ended 2010-10-23 with Ubuntu 10.10 (“Maverick Meerkat”) [that was 6 to 7 
years ago; nobody in their right mind should use that version anymore].  And 
Ubuntu is particularly quick in adopting new Firefox versions.

I implore you to apply more critical thinking to *everything* that you read.
 
-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

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


Thread

Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-25 14:59 +0200
  Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-25 17:18 +0200
    Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-25 19:47 +0200
      Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-25 20:07 +0200
  Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 08:51 -0700
    Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-25 19:47 +0200
      Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-25 20:17 +0200
        Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-25 21:16 +0200
          Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-25 22:33 +0200
            Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-26 00:49 +0200
              Re: Interrogation of Shift-Key state Tim Streater <timstreater@greenbee.net> - 2016-06-26 00:06 +0100
              Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-26 11:05 +0200
      Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 12:17 -0700
        Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 12:23 -0700
        Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-26 00:34 +0200
        Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-18 20:29 +0200
          Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-18 15:17 -0700
            Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-20 07:23 +0200
              Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-20 00:03 -0700
                Re: Interrogation of Shift-Key state Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-20 11:48 +0200
                Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-25 13:39 -0700
      Re: Interrogation of Shift-Key state "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 12:20 -0700
      Re: Interrogation of Shift-Key state Tim Streater <timstreater@greenbee.net> - 2016-06-25 22:33 +0100
        Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-26 01:18 +0200
          Re: Interrogation of Shift-Key state Tim Streater <timstreater@greenbee.net> - 2016-06-26 00:23 +0100
            Re: Interrogation of Shift-Key state Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-26 01:37 +0200
              Re: Interrogation of Shift-Key state Tim Streater <timstreater@greenbee.net> - 2016-06-26 09:41 +0100
  Re: Interrogation of Shift-Key state - workaround Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-26 00:33 +0200
    Re: Interrogation of Shift-Key state - workaround "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-26 00:53 +0200
      Re: Interrogation of Shift-Key state - workaround Janis Papanagnou <janis_papanagnou@hotmail.com> - 2016-06-26 01:31 +0200
        Re: Interrogation of Shift-Key state - workaround "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 16:52 -0700
        Re: Interrogation of Shift-Key state - workaround "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-26 01:56 +0200
    Re: Interrogation of Shift-Key state - workaround "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 16:50 -0700
  Re: Interrogation of Shift-Key state Joao Rodrigues <jr@none.com> - 2016-06-25 20:34 -0300

csiph-web