Path: csiph.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Interrogation of Shift-Key state Date: Sat, 20 Aug 2016 07:23:01 +0200 Organization: PointedEars Software (PES) Lines: 63 Message-ID: <4981358.DvuYhMxLoT@PointedEars.de> References: <9a42c75f-3239-4a70-9ce3-7434db0edd00@googlegroups.com> <2365735.mvXUDI8C0e@PointedEars.de> <12d9fda2-1369-473e-8415-3739eb04d6a4@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1471670583 28861 eJwNxMkRACAIBLCWuBawHNHZ/kvQPAJPzVORyADBVQh0FLZOQmoo9nPbYF+2tlvdRXiMHNUHAnoQSg== (20 Aug 2016 05:23:03 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 20 Aug 2016 05:23:03 +0000 (UTC) User-Agent: KNode/4.14.2 X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXikDdzkGw/59gkk5j72AyUimeqvY2YBTQgc+v/PYdMHrWsgDqUHUJbz4rahFt X-User-ID: eJwNwoERwCAIBLCVAHm+joMC+49gL8EKjUsPhGN+lcVek+VFqwzjkMA1uUntk9wq+whb4GI9ovssiH0N5DxofxWF Cancel-Lock: sha1:QW7TFQQ8S2TSq+bEHLhJWxUPRR0= Xref: csiph.com comp.lang.javascript:31120 Michael Haufe (TNO) wrote: > On Thursday, August 18, 2016 at 1:29:19 PM UTC-5, 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. > > There is nothing there that corroborates your belief. >> > 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* - “On Windows, CapsLock, NumLock and ScrollLock [did not dispatch the ‘keypress’] event. - On Linux, CapsLock, NumLock and ScrollLock [dispatched the ‘keypress’] event. - On Mac, CapsLock dispatched only [the ‘keydown’] event, [the] NumLock key (without Fn key, i.e., external keyboard's NumLock key) dispatched the ‘keydown’, ‘keypress’, and ‘keyup’ events. The NumLock key with Fn key and ScrollLock key don't dispatch any key events.” from before “2010-10-08 01:55 PDT” when that bug was reported to before “2013-07-23 11:04:32 PDT” when it was FIXED. Who cares? “Currently, neither modifier keys nor dead keys cause keypress event(s).” (AISB) >> > So now your left with the problem of telling the difference between >> > someone holding down the shift key and someone mashing on the keyboard >> > in succession. >> Most certainly not. > > Again, see the above link. There is neither a mention that the “keyup” event would be fired while the Shift key were held down, nor is the Shift key mentioned there. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.