Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2003
    Posts
    891

    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

  2. #2
    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

  3. #3
    Join Date
    Oct 2006
    Location
    London, UK
    Posts
    351
    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

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    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")
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    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).

  6. #6
    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

  7. #7
    Join Date
    Feb 2005
    Location
    Birmingham, Alabama
    Posts
    175
    Thanks ROBO! just what I needed for my App!!!

  8. #8
    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

  9. #9
    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!

  10. #10
    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.

Similar Threads

  1. .swf in Web Object - can't jump to AMS page
    By DrCode in forum AutoPlay Media Studio 6.0
    Replies: 19
    Last Post: 11-29-2006, 03:45 AM
  2. HOW TO: Return a Web Browser Object to the Original URL after a Page Jump
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 02-03-2003, 09:18 AM
  3. INFO: Difference between the Media Player Object and the AVI Object
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-29-2002, 02:15 PM
  4. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM
  5. Replies: 0
    Last Post: 10-04-2002, 10:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts