diff --git a/UI/Input/Touch/TouchManager.js b/UI/Input/Touch/TouchManager.js index ca147ef..5eb848b 100644 --- a/UI/Input/Touch/TouchManager.js +++ b/UI/Input/Touch/TouchManager.js @@ -83,7 +83,27 @@ jsOMS.preventAll(event); if (elapsedTime > 300 && distY < 3 && distX < 3) { - // todo: handle long press here + let rightClick = document.createEvent('MouseEvents'); + + rightClick.initMouseEvent( + 'click', + true, // canBubble + true, // cancelable + window, // view - set to the window object + 1, // detail - # of mouse clicks + touch.pageX, // screenX - the page X coordinate + touch.pageY, // screenY - the page Y coordinate + touch.pageX, // clientX - the window X coordinate + toch.pageY, // clientY - the window Y coordinate + false, // ctrlKey + false, // altKey + false, // shiftKey + false, // metaKey + 2, // button - 1 = left, 2 = right + null // relatedTarget + ); + + document.dispatchEvent(rightClick); } else if (elapsedTime < 500) { let e = new Event('keyup');