Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanthrax committed May 26, 2019
1 parent 2edd1be commit 1bbef09
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
28 changes: 28 additions & 0 deletions windows/client/OctopusClient/OctopusClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -31,6 +46,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
Expand All @@ -53,6 +69,18 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion windows/client/OctopusClient/OctopusClient.csproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
Expand Down
22 changes: 20 additions & 2 deletions windows/client/OctopusClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,16 @@ public void Run(byte clientId, string key) {
type = encreader.ReadUInt16();
code = encreader.ReadUInt16();
value = encreader.ReadInt32();
encreader.Close();
}
else if (enc == 0) {
UInt32 rnd = reader.ReadUInt32();
type = reader.ReadUInt16();
code = reader.ReadUInt16();
value = reader.ReadInt32();
}
else continue;

reader.Close();

//Console.WriteLine("Type:" + type + " Code:" + code + " Value:" + value);
//continue;
Expand All @@ -239,8 +241,12 @@ public void Run(byte clientId, string key) {
}
}
else if (type == (uint)LinuxEventTypes.EV_KEY) {

if (code >= (uint)UsefulConst.BTN_MIN && code <= (uint)UsefulConst.BTN_MAX) {
// Mouse Buttons

if (value == 2) continue; // Don't send repeats

if (code == (uint)UsefulConst.BTN_LEFT) {
StackMouseInput(0, 0, 0, value > 0 ? (uint)MouseEventFlags.MOUSEEVENTF_LEFTDOWN
: (uint)MouseEventFlags.MOUSEEVENTF_LEFTUP);
Expand Down Expand Up @@ -301,8 +307,20 @@ public void Run(byte clientId, string key) {
class Program
{
static void Main(string[] args) {
// Defaults
byte clientNum = 1;
string encKey = "octopus";

if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) {
clientNum = byte.Parse(args[0]);
}

if (args.Length > 1 && !string.IsNullOrEmpty(args[1])) {
encKey = args[1];
}

OctopusClient octopusClient = new OctopusClient();
octopusClient.Run(byte.Parse(args[0]), args[1]);
octopusClient.Run(clientNum, encKey);
}
}
}

0 comments on commit 1bbef09

Please sign in to comment.