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


Groups > comp.lang.javascript > #30731

Re: Interrogation of Shift-Key state

Path csiph.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Interrogation of Shift-Key state
Date Sat, 25 Jun 2016 20:07:33 +0200
Organization PointedEars Software (PES)
Lines 25
Message-ID <18572732.4csPzL39Zc@PointedEars.de> (permalink)
References <nklv6p$eap$1@gioia.aioe.org> <2962054.LZWGnKmheA@PointedEars.de> <nkmg39$1b8k$1@gioia.aioe.org>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1466878056 699 eJwFwYEBwCAIA7CXEGmZ52AZ/59ggs1FZRAMDCY0/7VvZ2WhrrriiGn7ZDtPqK048NVQeeoBLZERjA== (25 Jun 2016 18:07:36 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Sat, 25 Jun 2016 18:07:36 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwFwQcBACAIBMBKMh4wjqz+EbyDGFm5Gkyx2JHQVlunl5no4RlcEj63hDMArTTb9SVB9cFMnC4hj1fJH2DzFfA=
Cancel-Lock sha1:ErvoR8OQGChQfQ1iRtnF3uFePRk=
X-NNTP-Posting-Host eJwNyMEBwCAIA8CVhJIo6zSS/Udo73l4GNQuggXDL904e/kuZMyFHKgY9pnUfzmcltyKRvEDGUcQ5w==
Xref csiph.com comp.lang.javascript:30731

Show key headers only | View raw


Janis Papanagnou wrote:

> On 25.06.2016 17:18, Thomas 'PointedEars' Lahn wrote:
>> Janis Papanagnou wrote:
>>> My application context is a function that is triggered when a button is
>>> pressed. Is there a simple way to just interrogate the Shift-Key status
>>> in that function?
>> Yes.
> 
> How?

In the W3C/WHATWG DOM, an event listener is passed a reference to the event 
object as first argument (if you need to support the legacy MSHTML DOM as 
well, you need to read the “window.event” property instead).  Event objects 
have a “shiftKey” property whose value is “true” if the Shift key was 
pressed when the event was fired, “false” otherwise.  And you can pass the 
property value to your function.

HTH

-- 
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