🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.inetsdk.programming.scripting.jscript
Article #10

Re: event handler for right mouse button in JS, possible?

#10
From: Martin Honnen
Date: Wed, 29 Sep 1999 00:00
23 lines
1687 bytes
Yes, you just use one event handler for the document or window object
and then check which button was pressed for instance
 if (document.layers)
    document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown =
    function (evt) {
      if ((document.layers && evt.which == 3) || (document.all &&
event.button == 2)) {
       alert('right mouse button');
       return true;  // use false here to cancel menu in nn
      }
    };

Rafael Rasinger wrote:
> 
> Dear reader!
> 
> I am looking for the posibilty to uo use these JS-event handlers, but for
> the RIGHT mouse button. Is there a way to do it?
> 
> Thank you!
> 
>  Rafael
Technical Details
Message-ID: <37F226FD.DB41DA3D@sector27.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37f1c30a@news.kapsch.co.at>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d4a5,ac438531d738d94e
X-Google-Attributes: gid10d4a5,public
X-Google-Thread: 10731d,ac438531d738d94e
X-Google-Attributes: gid10731d,public
X-Google-Thread: fcc66,ac438531d738d94e
X-Google-Attributes: gidfcc66,public
X-Google-Thread: 10c71c,ac438531d738d94e
X-Google-Attributes: gid10c71c,public
X-Google-Thread: fb3cb,ac438531d738d94e
X-Google-Attributes: gidfb3cb,public
From: Martin Honnen <Martin.Honnen@sector27.de>
Subject: Re: event handler for right mouse button in JS, possible?
Date: 1999/09/29
Message-ID: <37F226FD.DB41DA3D@sector27.de>
X-Deja-AN: 530834182
Content-Transfer-Encoding: 7bit
References: <37f1c30a@news.kapsch.co.at>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Deutsche Telekom AG
Mime-Version: 1.0
Newsgroups: microsoft.public.inetsdk.programming.scripting.jscript,microsoft.public.scripting.jscript,borland.public.intrabuilder.javascript,comp.lang.javascript,de.comp.lang.javascript