mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-10 06:38:41 +00:00
Only long press implemented other elements where already implemented
This commit is contained in:
parent
1088649fc3
commit
44f7ddc02d
|
|
@ -83,7 +83,27 @@
|
||||||
jsOMS.preventAll(event);
|
jsOMS.preventAll(event);
|
||||||
|
|
||||||
if (elapsedTime > 300 && distY < 3 && distX < 3) {
|
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) {
|
} else if (elapsedTime < 500) {
|
||||||
let e = new Event('keyup');
|
let e = new Event('keyup');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user