LibGDX - HTML Right Click?

When right clicking on a LibGDX App, the browser tool function pops up (view image, save image as etc). Any idea why? Also the TAB key doesn’t work on HTML either, and there are other problems, with keys.

What causes this behavior? Are there any fixes for this?

Okay so I fixed right clicking by preventing the canvas from opening the context menu in the index.html, but I’m completely stuck on why certain keys like TAB just don’t work :confused:

Also this feels sort of hacky, does LibGDX not support this by default?


    var embedHtml = document.getElementById("embed-html");
    embedHtml.oncontextmenu = function(e) {
        e.preventDefault();
    }

What happens if you return false from your click handler? Can you please post a MCVE?

More info here: https://github.com/libgdx/libgdx/wiki/Event-handling

The clicking has been fixed, it’s mostly the key input now. Nothing happens if false or true are returned. Was just curious if anyone else was having this same issue. :clue: