I am currently working on a project using a LeapMotion with a Javascript/html front-end. I would like to control the entire application with the LeapMotion (including clicking, click and drag, etc.). However, I have run into a bit of a problem.
I would like to trigger a MouseEvent("click")
, however, I do not want to trigger the event on a specific element (as discussed here). This is because I do not want to have to "manually" check for which element my LeapMotion cursor is over and call the trigger on it. Instead I would like to trigger a more "pure" click event in which Javascript determines what is being clicked. Is something like this possible? If not, are there any reasonable work arounds?
EDIT:
Some more information. I can currently determine in my code when I need to trigger a click event based on data from the LeapMotion. My problem is that I need a way to trigger a click event on the page. Currently, the solutions I have found can create a MouseEvent
but they then have to call it on a specific div/element/etc. I would like to trigger a more "global" MouseEvent
such that I can trigger it on the page instead of a specific element.