mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 15:53:23 +02:00
Translate pointer events into touch events.
This commit is contained in:
@@ -21,8 +21,8 @@ function VncConnection(conn, options) {
|
||||
|
||||
this._serverVersion = VncConnection.V3_008
|
||||
this._serverSupportedSecurity = [VncConnection.SECURITY_NONE]
|
||||
this._serverWidth = 720
|
||||
this._serverHeight = 1280
|
||||
this._serverWidth = 1080
|
||||
this._serverHeight = 1920
|
||||
this._serverPixelFormat = new PixelFormat({
|
||||
bitsPerPixel: 32
|
||||
, depth: 24
|
||||
@@ -368,9 +368,11 @@ VncConnection.prototype._read = function() {
|
||||
break
|
||||
case VncConnection.STATE_NEED_CLIENT_MESSAGE_POINTEREVENT:
|
||||
if ((chunk = this._consume(5))) {
|
||||
// buttonMask = chunk[0]
|
||||
// xPosition = chunk.readUInt16BE(1, true)
|
||||
// yPosition = chunk.readUInt16BE(3, true)
|
||||
this.emit('pointer', {
|
||||
buttonMask: chunk[0]
|
||||
, xPosition: chunk.readUInt16BE(1, true) / this._serverWidth
|
||||
, yPosition: chunk.readUInt16BE(3, true) / this._serverHeight
|
||||
})
|
||||
this._changeState(VncConnection.STATE_NEED_CLIENT_MESSAGE)
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user