diff --git a/webcrab/main.vb b/webcrab/main.vb index ef4a4e8..e066995 100755 --- a/webcrab/main.vb +++ b/webcrab/main.vb @@ -5,6 +5,7 @@ Public Class main Dim weblistener As HttpListener Dim lastpos As New Point(0, 0) Dim startpos As New Point(0, 0) + Dim lastmouseseq As Integer = 0 Dim nexttoggleclick As UInteger = MouseEventFlags.MOUSEEVENTF_LEFTDOWN Or MouseEventFlags.MOUSEEVENTF_RIGHTDOWN Or MouseEventFlags.MOUSEEVENTF_MIDDLEDOWN Or MouseEventFlags.MOUSEEVENTF_XDOWN Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles StartButton.Click @@ -39,8 +40,6 @@ Public Class main Dim context As HttpListenerContext = Nothing Dim resp As HttpListenerResponse Dim respstr As String = String.Empty - Dim lastpacket As Long = -1 - Dim lastpack As Long Dim leftclicking As Boolean = False While weblistener.IsListening Try @@ -57,13 +56,8 @@ Public Class main If path = "/" Then respstr = FileIO.FileSystem.ReadAllText("res/page.html") - lastpacket = 0 Else - Dim pack As Long = context.Request.QueryString("seq") - If pack > lastpack Then - respstr = handleinput(context.Request) - lastpack = pack - End If + respstr = handleinput(context.Request) End If If String.IsNullOrEmpty(respstr) Then @@ -117,11 +111,16 @@ Public Class main lastpos.Y = req.QueryString("y") startpos.X = req.QueryString("x") startpos.Y = req.QueryString("y") + lastmouseseq = 0 Case "move" 'trackpad touch move - mouse_event(MouseEventFlags.MOUSEEVENTF_MOVE, req.QueryString("x") - lastpos.X, req.QueryString("y") - lastpos.Y, 0, 0) - lastpos.X = req.QueryString("x") - lastpos.Y = req.QueryString("y") + Dim seq As Integer = req.QueryString("seq") + If seq > lastmouseseq Then + mouse_event(MouseEventFlags.MOUSEEVENTF_MOVE, req.QueryString("x") - lastpos.X, req.QueryString("y") - lastpos.Y, 0, 0) + lastpos.X = req.QueryString("x") + lastpos.Y = req.QueryString("y") + lastmouseseq = seq + End If Case "end" Dim tol As Integer = TapInput.Value diff --git a/webcrab/res/page.html b/webcrab/res/page.html index c620d0c..7197fe7 100755 --- a/webcrab/res/page.html +++ b/webcrab/res/page.html @@ -36,7 +36,6 @@ button:active { #canvas { width: 100%; background-color: #111; - outline: gray solid 1px; } div{ display: flex; @@ -44,7 +43,7 @@ div{ input{ background-color: #111; color: gray; - outline: gray solid 1px; + border: 1px solid gray; border: none; } @@ -53,40 +52,40 @@ input{
- - - + + +
- - - - - + + + + +
- - - - - + + + + +
- - - + + +
- - - - + + + +
- diff --git a/webcrab/webcrab.vbproj b/webcrab/webcrab.vbproj index fd840bf..9392ce5 100755 --- a/webcrab/webcrab.vbproj +++ b/webcrab/webcrab.vbproj @@ -153,7 +153,9 @@ PreserveNewest - + + PreserveNewest +