Results 1 to 3 of 3

Thread: Right click on viewport/canvas

  1. #1

    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?


  2. #2

    Re: Right click on viewport/canvas

    document.onmousedown = handleMouseDown;

    function handleMouseDown(event){

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

    true = menu comes up
    false = no menu

  3. #3

    Re: Right click on viewport/canvas

    Thanks zed. Very helpful!


Similar Threads

  1. 3d coordinates from 2D click?
    By Oceansoul in forum OpenGL ES
    Replies: 0
    Last Post: 07-02-2010, 01: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
Proudly hosted by Digital Ocean