Indigo Rose Software
  #1  
Old 12-09-2006
Roboblue's Avatar
Roboblue Roboblue is offline
Forum Member
 
Join Date: Dec 2003
Posts: 888
Web Object Right Click Management

We have had several discussions on disabling the right click (RC) on a Web Object. I have coded a couple of examples and some others have, also. None that I have seen or coded have satisfied me.
I was wanting to make an small e book viewer and since IE supports so many formats (.html, .txt, .jpg, .gif, .rtf, wave, .mid, and others if the system has the plugins), I thought I would use the Web object to display the books. The same principal applies for a product catalog, picture viewer, media player, etc. So disabling RC became a priority.
I still haven't came up with an elegant way to totally disable RC.
However, I thought, why not just replace the IE RC menu with my own custom menu? So, I did.
Here are two examples that I came up with.
The first one is just an RC disabler.
The second one is a custom menu example.
In the second one, I used WORM's powerful (and free ) keystroke dll to provide an external page Search function. It also has the page loading animation effect (on the Refresh button) I recently did.
To see the code, look at the Page-On Mouse Button event.
T0 prevent the RC menu from popping up outside of the Web object, you need to set the e_X and e_Y co-ordinates (or the inside coordinates of the object). This is the way I did it.

to get e_X co-ordinates
Web object from Left position and Web Object width
e_X > (left) and e_X < (Left + Width)

to get e_Y co-ordinates
Web object from Top position and Web Object Height
e_Y > (Top) and e_Y < (Top + Height)

This function, RCPos(), is in Global. Just be sure to change the object name (in this case "web") to the object you want to get the inside co-ordinates to. This would be useful for a Tab browser and to use same the code project to project.
I am also going to work on disabling the copy to clipboard keystrokes so that there isn't a way to select and copy. With that disabled, you can select with the left mouse, but not copy with Ctrl+C. Anyone wanting to do this right now is welcome to post it. I will, when it's done.
I haven't tried this yet, but I bet the same code would work for other objects as well, (like the WMP).
Attached Files
File Type: apz RCOnWebDisabledroboblue.apz (125.3 KB, 386 views)
File Type: apz RCOnWebCustomroboblue.apz (125.5 KB, 360 views)
Reply With Quote
  #2  
Old 05-10-2007
4thstar 4thstar is offline
Forum Member
 
Join Date: Oct 2005
Posts: 76
Hello Guys , almost exactly what i was after , it works great

question though..

I know this disables the right mouse button but i noticed that i can press the menu button on the keyboard and it displays the usual menu , not sure of the propper name for this button (very bottom 3 right from space bar with the Ctrl button to its right)

can anyone please advise to...

A: how i find the key number for that button
B: or what the number is..

Kind Regards
Carl
Reply With Quote
  #3  
Old 05-10-2007
mz241508's Avatar
mz241508 mz241508 is offline
Forum Member
 
Join Date: Oct 2006
Location: London, UK
Posts: 349
Quote:
A: how i find the key number for that button
You can find the key numbers in the help file (Search for: Virtual Keyboard Codes decimal hex) or check this: Key Codes
Reply With Quote
  #4  
Old 05-10-2007
RizlaUK's Avatar
RizlaUK RizlaUK is offline
Forum Member
 
Join Date: May 2006
Location: London UK
Posts: 3,129
also in the scripts folder in Gallery there is a "VirtualKeyCodes.lua", include this file in your global function to use the Decimal value of a key (rather than"VK.KEY")
Reply With Quote
  #5  
Old 05-10-2007
Desolator's Avatar
Desolator Desolator is offline
Forum Member
 
Join Date: Apr 2007
Location: Mar Sara
Posts: 292
Actually, that file makes it easier to use keystrokes, since you don't need to remember the codes, but simply use VK.KEY (i.e. VK.Delete).
Reply With Quote
  #6  
Old 09-30-2007
ZUPOT ZUPOT is offline
Forum Member
 
Join Date: Sep 2007
Posts: 2
Rigth clic menu????

Hi, as it is that I create a menu rigth clic with to say: Seleccionar (Select); Copiar (Copy); Colar (past); actualizar (Refresh)?
in web object

sorry my english, but I am Portuguese
thanks
Reply With Quote
  #7  
Old 11-24-2007
thetford's Avatar
thetford thetford is offline
Forum Member
 
Join Date: Feb 2005
Location: Birmingham, Alabama
Posts: 170
Thanks ROBO! just what I needed for my App!!!
Reply With Quote
  #8  
Old 12-21-2007
FoxLeader's Avatar
FoxLeader FoxLeader is offline
Forum Member
 
Join Date: Nov 2006
Location: Quebec, Canada.
Posts: 432
Thanks, that's exactly what I needed for my upcoming CoverFlow exemple!

Thanks Roboblue!

Regards,
FoxLeader
Reply With Quote
  #9  
Old 12-24-2007
FoxLeader's Avatar
FoxLeader FoxLeader is offline
Forum Member
 
Join Date: Nov 2006
Location: Quebec, Canada.
Posts: 432
Ok... finally, I had some time to look at it and realized that it is simply displaying another menu. Since that exemple has been posted, has anybody succeed to completely disable the rightclick over the webobject?

Or I have an idea... load a Javascript in the current page which will block the right click. I'll see with this and I'll comeback!
Reply With Quote
  #10  
Old 12-24-2007
FoxLeader's Avatar
FoxLeader FoxLeader is offline
Forum Member
 
Join Date: Nov 2006
Location: Quebec, Canada.
Posts: 432
If you have control on your page's content, you can use
PHP Code:
<script language="javascript">
document.oncontextmenu = function() {
    return 
false;
}
-->
</script> 
Personally, that solved my needs.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.swf in Web Object - can't jump to AMS page DrCode AutoPlay Media Studio 6.0 19 11-29-2006 04:45 AM
HOW TO: Return a Web Browser Object to the Original URL after a Page Jump Support AutoPlay Media Studio 4.0 Examples 0 02-03-2003 10:18 AM
INFO: Difference between the Media Player Object and the AVI Object Support AutoPlay Media Studio 4.0 Examples 0 10-29-2002 03:15 PM
HOWTO: Make a Media Player Object Go Full Screen Support AutoPlay Media Studio 4.0 Examples 0 10-23-2002 12:23 PM
INFO: Minimum requirements for the Flash Object, Media Player Object, and Web Browser Object Support AutoPlay Media Studio 4.0 Examples 0 10-04-2002 11:09 AM


All times are GMT -6. The time now is 02:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software