Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right Click

Status
Not open for further replies.

tmcneil

Technical User
Joined
Nov 17, 2000
Messages
294
Location
US
I would like to cause a right click to occur after pressing a button. Basically, the opposite of trapping the right-click event. Is this possible and can I choose a certain menu item in the right-click menu to fire off that menu item?

Todd
 
Well, the code would have to work in IE, Firefox and Firefox for Linux. FF for Windows and Linux are the same. I've never done it before and I'm coming up with zilch on my google searches, only preventing right clicks.

I'm doing this because we are using spellcheckers that create a menu item in the right click menu. I want to be able to fire it off when the user clicks on a button.

Todd
 
As I said - I don't think you can bring up the RMB menu programatically. Maybe there is a browser add-in for the spellchecker that lets you call it programatically (not via the menu)?

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Is it necessary to bring up the menu or just to execute the spellchecker option in the menu?

I know that in IE you can execute SOME menu commands from code so perhaps there is an approach that way.

Stamp out, eliminate and abolish redundancy!
 
theniteowl,

it would be necessary to bring up the right click menu and then the user would choose the spellchecker option. I also like the possibility of just executing the spellcheck option too. it's a choice I'll have to make when I am coding and testing the functionality.

Todd
 
I have seen scripts that create right-click menus of their own by trapping the right-click but that does not work in all browsers.

In IE there might be a way to execute through window.external though I have not seen any examples.
This link: Shows how to modify the IE right-click context menu and may give clues how to programmatically execute an item that has been added.


Stamp out, eliminate and abolish redundancy!
 
Thanks theniteowl.

I'll check it out.

Todd
 
Let us know if you find something.
I suspect BRPS is correct and that the best option is looking to see if your spell-checker has a method to call it from code rather than just from the right-click menu.
If it was intended to allow spell-checking from a web page then I would think it would have accessible methods.

Are you developing for an intranet where you can rely on IE being the browser? And possibly for MS Office being available on the client machines?

You can use ActiveX to call up the spell checker in MS Word on the client-side. I played around with some code recently to do just that for an internal web application and it works pretty slick. It just requires the client to be using IE and have MS Word on their device.


Stamp out, eliminate and abolish redundancy!
 
I'll check into what the spellchecker can provide in terms of customizing it. I'm developing for a customer and so it has to work on IE, FF and FF for Linux. We have tried the MS Word one initially and it worked ok, but it would not pick some mispelled words and was not intuitive to use. For instance, the menu options and data dictionary were not visible. ActiveX does not work in Firefox either, so we had to scrap it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top