fixes #6 fixes #7 fixes #8

Only long press implemented other elements where already implemented
This commit is contained in:
Dennis Eichhorn 2016-07-15 17:37:37 +02:00
parent 1088649fc3
commit 44f7ddc02d

View File

@ -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');