commit e949051568bba60605e44ca0ae292c83c9ca2d52 Author: moosecrab Date: Mon Jun 15 04:26:36 2020 -0700 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..6e5e5ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,369 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/visualstudio,dotnetcore +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,dotnetcore + +### DotnetCore ### +# .NET Core build folders +bin/ +obj/ + +# Common node modules locations +/node_modules +/wwwroot/node_modules + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# End of https://www.toptal.com/developers/gitignore/api/visualstudio,dotnetcore diff --git a/webmouse.sln b/webmouse.sln new file mode 100755 index 0000000..ff0aa13 --- /dev/null +++ b/webmouse.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "webmouse", "webmouse\webmouse.vbproj", "{78548D07-15EF-4268-9126-BB8FA39889C8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78548D07-15EF-4268-9126-BB8FA39889C8}.Debug|x86.ActiveCfg = Debug|x86 + {78548D07-15EF-4268-9126-BB8FA39889C8}.Debug|x86.Build.0 = Debug|x86 + {78548D07-15EF-4268-9126-BB8FA39889C8}.Release|x86.ActiveCfg = Release|x86 + {78548D07-15EF-4268-9126-BB8FA39889C8}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/webmouse/App.config b/webmouse/App.config new file mode 100755 index 0000000..7505428 --- /dev/null +++ b/webmouse/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/webmouse/My Project/Application.Designer.vb b/webmouse/My Project/Application.Designer.vb new file mode 100755 index 0000000..1e1232b --- /dev/null +++ b/webmouse/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.webmouse.main + End Sub + End Class +End Namespace diff --git a/webmouse/My Project/Application.myapp b/webmouse/My Project/Application.myapp new file mode 100755 index 0000000..6f67b33 --- /dev/null +++ b/webmouse/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + main + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/webmouse/My Project/AssemblyInfo.vb b/webmouse/My Project/AssemblyInfo.vb new file mode 100755 index 0000000..b43b2b1 --- /dev/null +++ b/webmouse/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/webmouse/My Project/Resources.Designer.vb b/webmouse/My Project/Resources.Designer.vb new file mode 100755 index 0000000..b382d76 --- /dev/null +++ b/webmouse/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("webmouse.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/webmouse/My Project/Resources.resx b/webmouse/My Project/Resources.resx new file mode 100755 index 0000000..ffecec8 --- /dev/null +++ b/webmouse/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/webmouse/My Project/Settings.Designer.vb b/webmouse/My Project/Settings.Designer.vb new file mode 100755 index 0000000..faf2b18 --- /dev/null +++ b/webmouse/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.webmouse.My.MySettings + Get + Return Global.webmouse.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/webmouse/My Project/Settings.settings b/webmouse/My Project/Settings.settings new file mode 100755 index 0000000..377f56d --- /dev/null +++ b/webmouse/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/webmouse/My Project/app.manifest b/webmouse/My Project/app.manifest new file mode 100755 index 0000000..ae45f48 --- /dev/null +++ b/webmouse/My Project/app.manifest @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webmouse/input.vb b/webmouse/input.vb new file mode 100755 index 0000000..d7a8823 --- /dev/null +++ b/webmouse/input.vb @@ -0,0 +1,43 @@ +Imports System.Runtime.InteropServices +Module input + + + + _ + Public Enum MouseEventFlags As UInteger + MOUSEEVENTF_ABSOLUTE = &H8000 + MOUSEEVENTF_LEFTDOWN = &H2 + MOUSEEVENTF_LEFTUP = &H4 + MOUSEEVENTF_MIDDLEDOWN = &H20 + MOUSEEVENTF_MIDDLEUP = &H40 + MOUSEEVENTF_MOVE = &H1 + MOUSEEVENTF_RIGHTDOWN = &H8 + MOUSEEVENTF_RIGHTUP = &H10 + MOUSEEVENTF_XDOWN = &H80 + MOUSEEVENTF_XUP = &H100 + MOUSEEVENTF_WHEEL = &H800 + MOUSEEVENTF_HWHEEL = &H1000 + End Enum + + _ + Private Sub mouse_event(dwFlags As UInteger, dx As Integer, dy As Integer, dwData As UInteger, dwExtraInfo As Integer) + End Sub + + Public Sub movemouse(dx As Integer, dy As Integer) + mouse_event(MouseEventFlags.MOUSEEVENTF_MOVE, dx, dy, 0, 0) + End Sub + + Public Sub leftclick() + mouse_event(MouseEventFlags.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) + System.Threading.Thread.Sleep(10) + mouse_event(MouseEventFlags.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) + End Sub + + Public Sub leftstart() + mouse_event(MouseEventFlags.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) + End Sub + + Public Sub leftrelease() + mouse_event(MouseEventFlags.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) + End Sub +End Module diff --git a/webmouse/main.Designer.vb b/webmouse/main.Designer.vb new file mode 100755 index 0000000..add36f1 --- /dev/null +++ b/webmouse/main.Designer.vb @@ -0,0 +1,121 @@ + _ +Partial Class main + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.StartButton = New System.Windows.Forms.Button() + Me.LogText = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.TapInput = New System.Windows.Forms.NumericUpDown() + Me.Label2 = New System.Windows.Forms.Label() + Me.DragInput = New System.Windows.Forms.NumericUpDown() + CType(Me.TapInput, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.DragInput, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'StartButton + ' + Me.StartButton.BackColor = System.Drawing.Color.Lime + Me.StartButton.Location = New System.Drawing.Point(12, 12) + Me.StartButton.Name = "StartButton" + Me.StartButton.Size = New System.Drawing.Size(75, 23) + Me.StartButton.TabIndex = 0 + Me.StartButton.Text = "Start" + Me.StartButton.UseVisualStyleBackColor = False + ' + 'LogText + ' + Me.LogText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.LogText.Location = New System.Drawing.Point(12, 41) + Me.LogText.Multiline = True + Me.LogText.Name = "LogText" + Me.LogText.ReadOnly = True + Me.LogText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.LogText.Size = New System.Drawing.Size(531, 291) + Me.LogText.TabIndex = 1 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(93, 17) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(96, 13) + Me.Label1.TabIndex = 2 + Me.Label1.Text = "Tap tolerance (px):" + ' + 'TapInput + ' + Me.TapInput.Location = New System.Drawing.Point(195, 14) + Me.TapInput.Name = "TapInput" + Me.TapInput.Size = New System.Drawing.Size(57, 20) + Me.TapInput.TabIndex = 3 + Me.TapInput.Value = New Decimal(New Integer() {5, 0, 0, 0}) + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(258, 17) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(83, 13) + Me.Label2.TabIndex = 4 + Me.Label2.Text = "Drag delay (ms):" + ' + 'DragInput + ' + Me.DragInput.Increment = New Decimal(New Integer() {100, 0, 0, 0}) + Me.DragInput.Location = New System.Drawing.Point(347, 14) + Me.DragInput.Maximum = New Decimal(New Integer() {2000, 0, 0, 0}) + Me.DragInput.Minimum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.DragInput.Name = "DragInput" + Me.DragInput.Size = New System.Drawing.Size(57, 20) + Me.DragInput.TabIndex = 5 + Me.DragInput.Value = New Decimal(New Integer() {300, 0, 0, 0}) + ' + 'main + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(555, 344) + Me.Controls.Add(Me.DragInput) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.TapInput) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.LogText) + Me.Controls.Add(Me.StartButton) + Me.Name = "main" + Me.Text = "Form1" + CType(Me.TapInput, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.DragInput, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents StartButton As System.Windows.Forms.Button + Friend WithEvents LogText As System.Windows.Forms.TextBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents TapInput As System.Windows.Forms.NumericUpDown + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents DragInput As System.Windows.Forms.NumericUpDown + +End Class diff --git a/webmouse/main.resx b/webmouse/main.resx new file mode 100755 index 0000000..29dcb1b --- /dev/null +++ b/webmouse/main.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/webmouse/main.vb b/webmouse/main.vb new file mode 100755 index 0000000..0fc1534 --- /dev/null +++ b/webmouse/main.vb @@ -0,0 +1,112 @@ +Imports System.Threading +Imports System.Net +Public Class main + Dim weblistener As HttpListener + + Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles StartButton.Click + If Not weblistener Is Nothing Then + weblistener.Abort() + weblistener = Nothing + log("Stopped") + StartButton.BackColor = Color.Lime + StartButton.Text = "Start" + Else + weblistener = New HttpListener + weblistener.Prefixes.Add("http://+:8080/") + weblistener.Start() + Dim listenthread As New Thread(AddressOf listenforconnection) + listenthread.Start() + log("Started") + StartButton.BackColor = Color.Red + StartButton.Text = "Stop" + End If + + End Sub + + Public Sub listenforconnection() + Dim context As HttpListenerContext + Dim resp As HttpListenerResponse + Dim lastpos As New Point(0, 0) + Dim startpos As New Point(0, 0) + Dim lastpacket As Long = -1 + While weblistener.IsListening + Try + context = weblistener.GetContext() + Catch ex As Exception + If weblistener Is Nothing OrElse weblistener.IsListening = False Then + Exit Sub + End If + End Try + resp = context.Response + Dim path As String = context.Request.Url.AbsolutePath + log(context.Request.RemoteEndPoint.ToString & " " & path) + + ' check for valid command packets + + If path = "/" Then + Dim mainpagebytes As Byte() = FileIO.FileSystem.ReadAllBytes("page.html") + resp.OutputStream.Write(mainpagebytes, 0, mainpagebytes.Length) + resp.Close() + lastpacket = 0 + Continue While + + ElseIf path.StartsWith("/move/") Then + Dim x As Integer = path.Split("/")(2) + Dim y As Integer = path.Split("/")(3) + Dim pack As Long = path.Split("/")(4) + If pack > lastpacket Then + movemouse(x - lastpos.X, y - lastpos.Y) + lastpos.X = x + lastpos.Y = y + lastpacket = pack + End If + + ElseIf path.StartsWith("/start/") Then + Dim x As Integer = path.Split("/")(2) + Dim y As Integer = path.Split("/")(3) + Dim pack As Long = path.Split("/")(4) + If pack > lastpacket Then + lastpos.X = x + lastpos.Y = y + startpos.X = x + startpos.Y = y + lastpacket = pack + End If + + ElseIf path.StartsWith("/end/") Then + Dim x As Integer = path.Split("/")(2) + Dim y As Integer = path.Split("/")(3) + Dim pack As Long = path.Split("/")(4) + If pack > lastpacket Then + Dim tol As Integer = TapInput.Value + If (Math.Abs(x - startpos.X) < tol) And (Math.Abs(y - startpos.Y) < tol) Then + leftclick() + End If + lastpacket = pack + End If + End If + + Dim respstr As String = "ok" + Dim respbytes As Byte() = System.Text.Encoding.UTF8.GetBytes(respstr) + resp.OutputStream.Write(respbytes, 0, respbytes.Length) + resp.Close() + + End While + End Sub + + Private Sub Form1_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing + If Not weblistener Is Nothing Then + weblistener.Abort() + End If + End Sub + + Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + Control.CheckForIllegalCrossThreadCalls = False + Button1_Click(sender, e) + End Sub + Private Sub log(str As String) + LogText.Text = Now.ToString("[HH:mm:ss.fff] ") & str & vbNewLine & LogText.Text + End Sub + + +End Class diff --git a/webmouse/webmouse.vbproj b/webmouse/webmouse.vbproj new file mode 100755 index 0000000..1f12efb --- /dev/null +++ b/webmouse/webmouse.vbproj @@ -0,0 +1,133 @@ + + + + Debug + x86 + + + 2.0 + {78548D07-15EF-4268-9126-BB8FA39889C8} + WinExe + webmouse.My.MyApplication + webmouse + webmouse + 512 + WindowsForms + v4.0 + Client + + + x86 + true + full + true + true + bin\Debug\ + webmouse.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + x86 + pdbonly + false + true + true + bin\Release\ + webmouse.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + My Project\app.manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + main.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + main.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file