...

View Full Version : right click in NS



ez4ne12c
12-14-2004, 07:25 AM
Hi,
I know this practice is frowned upon on the open web but i would like
to use the right mouse click as an undo button on my intranet page.

It works fine in IE with the oncontextmenu event, its the last step i
need to get my code cross-browser as everything else works.

There are some users who refuse to use IE and want to use Netscape
so i would like to get it functioning the same in all browsers
Can it be done or does NS absolutely disallow it?
Any help appreciated
ez

jbot
12-14-2004, 09:27 AM
There are some users who refuse to use IE and want to use Netscape

use an HTA for your intranet, then they won't know wot they're using and you'll be able to finer control over your code. also, you'll be able to use ActiveX for any natty windows' coding you may need to do.

ez4ne12c
12-14-2004, 10:59 AM
Wow i never even heard of HTA before. Looks interesting.
Unfortunately the users are linux/unix users hence the aversion to IE..
I dont think some of them even have a windows box..

What I have tried is

<span id='my_map' onclick='get_latlon();' onContextMenu='undo_latlon();return false;'><img src='mymap'></span>

good for IE 5.5+
dont seem to work in NS..7.1 Mozilla 5.0...

any suggestions would be appreciated?
ez

jbot
12-14-2004, 11:32 AM
Unfortunately the users are linux/unix users hence the aversion to IE. any suggestions would be appreciated?

then if some are using Mozilla anyways, then why not base your whole app on Mozilla and create it using XUL?

Willy Duitt
12-14-2004, 02:06 PM
Unfortunately the users are linux/unix users hence the aversion to IE..
I dont think some of them even have a windows box..

This doesn't sound like an intranet :rolleyes:

jbot
12-14-2004, 02:28 PM
This doesn't sound like an intranet

not necessarily, Willy. we've got Macs on our network, as well as PCs. but it still counts as an intranet - well, it would if we actually had an intranet (as in the software), not just the internet network!

Willy Duitt
12-14-2004, 02:44 PM
not necessarily, Willy. we've got Macs on our network, as well as PCs. but it still counts as an intranet - well, it would if we actually had an intranet (as in the software), not just the internet network!


My comment was mostly due to this statement: "I dont think some of them even have a windows box.."

I would think in a controlled enviorment you would know what your users are using... Besides, I really don't care either way and I have long ago stopped answering these types of browser disabling questions, regardless of how they are packaged... But I have recently noticed that alot of people are now packaging their browser disabling questions as intranet related regardless if it is web based or not, with the hope of avoiding the entire accessibility and morality rants which inevitably follow these types of questions...

Carryon...

.....Willy

jbot
12-14-2004, 03:14 PM
I really don't care either way and I have long ago stopped answering these types of browser disabling questions, regardless of how they are packaged.

fair play. i feel like that. but i also feel it's better to stop others from following suit rather than merely disuade the original poster. that's all.



But I have recently noticed that alot of people are now packaging their browser disabling questions as intranet related regardless if it is web based or not, with the hope of avoiding the entire accessibility and morality rants which inevitably follow these types of questions...

yeah, me too. some people have no shame. :rolleyes:


btw: you replied unnervingly quickly. did you have a premonition of my response. LOL

ez4ne12c
12-14-2004, 10:08 PM
In all honesty this is not a packaged question.
We have every type of machine on our network.
HP servers, supercomputers, cray, NEC, PC running windows linux
MACs.. you name it we have it ..
we are all on the same domain, thats what i refer to as a
our intranet, albeit a large one. It is a large organisation.
Anyway I have put an undo button on for NS users.. it works in IE as well :D
Its just alot easier for users to undo rightclick than go to a button..

I would prefer not to take away the context menu.
I can only see onclick (left click) and oncontextmenu (right click)
are there any other click events i could use?
I have tried onDoubleClick but it just takes the onclick event
OnMouseDown and OnMouseUp wont work in this case

I would be really happy to try another workable solution if anyone knows one.
ez

glenngv
12-15-2004, 01:37 AM
Its just alot easier for users to undo rightclick than go to a button..

Why? :confused:
Isn't this much easier for users?
<input type="button" value="Undo" onclick="undo()" />

than right clicking something? You would have to inform the user that the right click does undo by way of a tooltip or something.

ez4ne12c
12-15-2004, 09:46 AM
Hey glenngv,
thanks for all your help in the past.
Its easier because the users are selecting points on a large image.
The coordinates of the points are registered.
If the user makes a mistake, or wants to backtrack along
the chosen path its just alot quicker to right click than to get the mouse out
of the image and onto a button, then back to very close to where you were
before. It really functions efficiently for users under IE
NS users will be dragging the mouse back and forward alot so
i am trying to save them some effort. Can I somehow use another mouse feature like middle button, or double click that way users can keep their context menu. It seems to me the only click event i can use cross-browser
is left click...is that true?
ez

PS Willy.. lighten up mate.
To somewhat rephrase what i need and what i dont need..

I dont want to disable the browser, if I did that, I would probably lose my job.
I dont want to take away the context menu. I would like the users to keep all
the functionality they are used to..

i do need a mouse click event other than onclick.
I need it to work cross browser.
It would be great if this hypothetical mouse click
event was available to me, a developer, and not already pre-assigned by the browser vendor for a particular purpose (such as the right mouse button for a context menu.)

I have a manual that states there are click events such as doubleClick
but these dont seem to work... for me anyway, what about onmiddlebutton??

So i am stuck...
In IE i can only use onclick and oncontextmenu...
as these are the only 2 mouse click events that work for me in IE..
That forces me to consider the same functionality in NS, hence my question.

Take the question on face value, I have never asked a veiled or packaged question on this, or any other forum.

If the answer is it cant be done then thanks for the information.
If someone has a solution ... ditto that would be fantastic.
ez

glenngv
12-15-2004, 12:58 PM
Why not make it toggle? When you click an already clicked coordinate, you unregister it.

RoyW
12-15-2004, 03:40 PM
I make no judgement as to how you should design your application.
The question was (basically)
"can javascript capture and use the right mouse click event in NS"
and the answer is yes


<script>
if(document.captureEvents)
{
document.captureEvents(Event.MOUSECLICK);
document.onclick=function catchNsMouseEvent(nsEvent)
{
if(nsEvent.which == 3)
{
alert("Right Click");
return false;
}
}
}
</script>

andilcho
12-15-2004, 08:46 PM
I think none of you guys know what you are talking about.

Over & out :cool:

jbot
12-15-2004, 09:18 PM
I think none of you guys know what you are talking about.

what's that supposed to mean?

ez4ne12c
12-15-2004, 09:41 PM
Andichlo..
that may be true of me sometimes ;)
But it certainly doesnt apply to generally to people on this forum,
particularly some of the current respondants who in my experience
generally know alot more than what they are talking about :D
Many thans to u Roy
I will try that and see what users think.
The app will have some configuration options so I will leave
the right click function up to the end user...

Your idea is also good glenngv ... I will put that in as a user configurable alternative.. its certainly better than a button.

Final note is that all my dev/work is on our intranet but if you would like to look at our external web, (we get 4.5 million hits per week).. its at
http://www.bom.gov.au
Thanks
ez

jbot
12-15-2004, 11:00 PM
my problem with the event capture route is what happens if the user has a five button mouse and has the buttons set differently or if they've swapped their mouse from right-to-left handed - won't that counter any button capturing.

for me, Glenn's idea is maybe the best, even tho Roy's works technically.

*just something to consider* :thumbsup:

glenngv
12-16-2004, 01:12 AM
if they've swapped their mouse from right-to-left handed - won't that counter any button capturing.

No it won't. But I think my suggestion is the most intuitive.

andilcho
12-16-2004, 04:35 AM
Yeah !!!!!!!!!!!!

I just think that perhaps some of you might be quite confused or don't know quite what you are talking about !!!!!!!!!!!!!!!!!!!

But of course,,,,,,,,,,,, I could be wrong !!!!!!!!!!!

Andilcho :cool:

Brandoe85
12-16-2004, 05:34 AM
Yeah !!!!!!!!!!!!

I just think that perhaps some of you might be quite confused or don't know quite what you are talking about !!!!!!!!!!!!!!!!!!!

But of course,,,,,,,,,,,, I could be wrong !!!!!!!!!!!

Andilcho :cool:
If your going to make a post, make sure its useful.

jbot
12-16-2004, 10:25 AM
I just think that perhaps some of you might be quite confused or don't know quite what you are talking about

in what regard? what are we confused about and why don't we know what we're talking about?

i don't know what your premise is, because you haven't actually said anything meaningful in your post, just made a statement devoid of reasoning. if you've got an argument, you have to qualify it with an example, otherwise there's no point to your post.

seems to me it is you who doesn't understand us!

ez4ne12c
12-16-2004, 11:11 AM
! :thumbsup: andilcho... ! :cool:
get a life mate!
ez
P.S. Your original post ended with
'OVER AND OUT' do you know what that means?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum