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, 25 Jun 2016 20:17:56 +0200 Organization: PointedEars Software (PES) Lines: 55 Message-ID: <1652837.7Z3S40VBb9@PointedEars.de> References: <9a42c75f-3239-4a70-9ce3-7434db0edd00@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 1466878677 3143 eJwFwYEBwCAIA7CbrKXIOayT/08wia0lJxViTEyWWUCC90juPCjPNUA4usf0d0SstbP+fg//ENw= (25 Jun 2016 18:17:57 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 25 Jun 2016 18:17:57 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwQcBADAIAzBNfJDD6fxLWGLi5Bvq5mrPXo6vErW8PaweYRrHhezxA7dUIhrvTmI1K9TMnKNkl0c+jncWkA== Cancel-Lock: sha1:qh1hHNhx13yn6XfdwOo7aXq2oiI= X-NNTP-Posting-Host: eJwFwYEBwDAEBMCVKP5jHBH2H6F3YVA0HQGPjRW4GtfPxzswVnvlUvqapL7Wycco8Tn5BvIDDRIQ1w== Xref: csiph.com comp.lang.javascript:30733 Janis Papanagnou wrote: > On 25.06.2016 17:51, Michael Haufe (TNO) wrote: >> I suggest reading a bit on this: >> >> >> >> It can be "simple" if you make it so. > > Hmm.. - you seem to be very stingy here with providing "simple" > information. If it "can be so simple", would it be possible to just post > the way to go, please? No. Do your own homework. > The information on that link Resource/document; _not_ “link”. The (hyper)link is the *reference* to the resource/document instead. > seems to suggest installing event listener for keyup/keydown […] It does not. > (which I wanted to avoid). Why do you want to avoid using the keydown/keyup events? > Or following the 'keyboardEvent()' link on the above 'keyboadEvent' link > suggests using a KeyboardEvent() object. My naive tries on the latter > (yes, I don't know much of these issues; else I wouldn't ask the question > here), e.g. > > var x = new KeyboardEvent("keypress"); > if (x.shiftKey) { > alert("shift"); > } else { > alert("no shift"); > } > > were ineffective, though, so more concrete input would be appreciated. You should read more carefully. With the above you *create* the keyboard event object (and can simulate keypresses by dispatching it to elements). You need to use the keyboard event object that the runtime environment creates for you, and dispatches to your event listener, instead. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.