Results 1 to 3 of 3

Thread: Right click on viewport/canvas

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    13

    Right click on viewport/canvas

    When a user right clicks an object in my game I would like to be able to have a menu come up. Is it possible to override the right click event only for the canvas and still allow normal right click functions outside of the canvas?

    Thanks,
    Achilles

  2. #2

    Re: Right click on viewport/canvas

    document.onmousedown = handleMouseDown;

    function handleMouseDown(event){

    if ( mouse_pos ) inside gl canvas
    return false;
    else
    return true;
    }

    true = menu comes up
    false = no menu

  3. #3
    Junior Member
    Join Date
    May 2011
    Posts
    13

    Re: Right click on viewport/canvas

    Thanks zed. Very helpful!

    -Achilles

Similar Threads

  1. 3d coordinates from 2D click?
    By Oceansoul in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 07-02-2010, 12:38 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
  •