webrtc-streaming-core
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -22,2 +22,4 @@ "use strict"; | ||
this.doMove = false; | ||
this.holdTimeout = 0; | ||
this.leftMouseDown = true; | ||
this.touchStart = { | ||
@@ -306,3 +308,11 @@ clientX: initial.clientX, | ||
(0, log_1.Log)(log_1.LogLevel.Debug, `touchstart: ${i}.`); | ||
this.onGoingTouchs.set(touches[i].identifier, new TouchData(touches[i])); | ||
let touch = new TouchData(touches[i]); | ||
// hold for left click | ||
touch.holdTimeout = setTimeout(() => { | ||
touch.leftMouseDown = true; | ||
this.SendFunc((new keys_model_2.HIDMsg(keys_model_1.EventCode.MouseDown, { | ||
button: '0' | ||
})).ToString()); | ||
}, 300); | ||
this.onGoingTouchs.set(touches[i].identifier, touch); | ||
} | ||
@@ -317,2 +327,6 @@ } | ||
const prev_touch = this.onGoingTouchs.get(identifier); | ||
if (prev_touch.holdTimeout != 0) { | ||
clearTimeout(prev_touch.holdTimeout); | ||
prev_touch.holdTimeout = 0; | ||
} | ||
if (prev_touch == null) { | ||
@@ -343,2 +357,8 @@ (0, log_1.Log)(log_1.LogLevel.Error, `cannot find touch identifier ${identifier}`); | ||
for (let i = 0; i < touches.length; i++) { | ||
const touch = this.onGoingTouchs.get(touches[i].identifier); | ||
if (touch.leftMouseDown) { | ||
this.SendFunc((new keys_model_2.HIDMsg(keys_model_1.EventCode.MouseUp, { | ||
button: '0' | ||
})).ToString()); | ||
} | ||
this.onGoingTouchs.delete(touches[i].identifier); | ||
@@ -345,0 +365,0 @@ } |
{ | ||
"name": "webrtc-streaming-core", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/app.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132548
2057