🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#7
From: Rafael Rasinger
Date: Wed, 29 Sep 1999 00:00
88 lines
3307 bytes
Hi Vidar!

Thank you again! A last question. Using your method, which perfectly works,
one problem arises. The contextmenu also appears afterwards. Is there a
possibility to switch it off using script?

Thanx a lot!

> This should do the trick(Im no NN expert) :P
>
> if(document.all) document.onmousedown=gMouse;
> if (document.layers){ window.captureEvents(Event.MOUSEDOWN);
> window.onmousedown=gMouse;
> }
> function gMouse(e){
> if(navigator.appName=="Netscape"&&e.which==3) alert("Right button");
> else if(event.button==2) alert("Right button");
> }
>
>
> --
> Best Regards
>  Vidar Petursson
> http://www.icysoft.com
> TheKing@icysoft.com
> icysoft@vortex.is
>
> No matter where you go there you are
> -
> Rafael Rasinger <rasinger@atc.co.at> wrote in message
> news:37f1ea4e@news.kapsch.co.at...
> > Hi Vidar!
> >
> > Thanx for your answer!
> >
> > but I need it in JS.
> > Or at least it should be able to run on Netsc and MSIE
> >
> > cu, Rafael
> >
> > Vidar Petursson <icysoft@vortex.is> schrieb in im Newsbeitrag:
> > uGiUVrlC$GA.291@cppssbbsa02.microsoft.com...
> > > Hi
> > >
> > > This will do it(Its DOM not Jscript)
> > >
> > > function gMouse(){
> > > if(event.button==2) alert("Right button");
> > > }
> > >
> > > <body onmousedown="gMouse()">
> >
> > > More info here:
> > >
> >
>
http://msdn.microsoft.com/workshop/c-frame.htm#/workshop/author/default.asp
> > >
> > > Note URL may wrap
> > > --
> > > Best Regards
> > >  Vidar Petursson
> > > http://www.icysoft.com
> > > TheKing@icysoft.com
> > > icysoft@vortex.is
> > >
> > > No matter where you go there you are
> > > -
> > > Rafael Rasinger <rasinger@atc.co.at> wrote in message
> > > news:37f1c30a@news.kapsch.co.at...
> > > > 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: <37f20e1b@news.kapsch.co.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37f1c30a@news.kapsch.co.at> <uGiUVrlC$GA.291@cppssbbsa02.microsoft.com> <37f1ea4e@news.kapsch.co.at> <OujxGnmC$GA.289@cppssbbsa02.microsoft.com>

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: 10c71c,ac438531d738d94e
X-Google-Attributes: gid10c71c,public
X-Google-Thread: fcc66,ac438531d738d94e
X-Google-Attributes: gidfcc66,public
X-Google-Thread: fb3cb,ac438531d738d94e
X-Google-Attributes: gidfb3cb,public
From: "Rafael Rasinger" <rasinger@atc.co.at>
Subject: Re: event handler for right mouse button in JS, possible?
Date: 1999/09/29
Message-ID: <37f20e1b@news.kapsch.co.at>
X-Deja-AN: 530698675
References: <37f1c30a@news.kapsch.co.at> <uGiUVrlC$GA.291@cppssbbsa02.microsoft.com> <37f1ea4e@news.kapsch.co.at> <OujxGnmC$GA.289@cppssbbsa02.microsoft.com>
X-Original-NNTP-Posting-Host: 193.80.86.140
X-Trace: 29 Sep 1999 15:03:23 +0100, 193.80.86.140
Organization: Kapsch AG; Vienna, Austria
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: microsoft.public.inetsdk.programming.scripting.jscript,microsoft.public.scripting.jscript,borland.public.intrabuilder.javascript,comp.lang.javascript,de.comp.lang.javascript
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@kapsch.net