Skip to content

Commit 9ba7afb

Browse files
committed
Merge branch 'master' of github.com:duncanthrax/octopus
2 parents f51d42f + 1bbef09 commit 9ba7afb

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

windows/client/OctopusClient/OctopusClient.csproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@
1212
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<PublishUrl>publish\</PublishUrl>
16+
<Install>true</Install>
17+
<InstallFrom>Disk</InstallFrom>
18+
<UpdateEnabled>false</UpdateEnabled>
19+
<UpdateMode>Foreground</UpdateMode>
20+
<UpdateInterval>7</UpdateInterval>
21+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
22+
<UpdatePeriodically>false</UpdatePeriodically>
23+
<UpdateRequired>false</UpdateRequired>
24+
<MapFileExtensions>true</MapFileExtensions>
25+
<ApplicationRevision>0</ApplicationRevision>
26+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
27+
<IsWebBootstrapper>false</IsWebBootstrapper>
28+
<UseApplicationTrust>false</UseApplicationTrust>
29+
<BootstrapperEnabled>true</BootstrapperEnabled>
1530
</PropertyGroup>
1631
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1732
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -31,6 +46,7 @@
3146
<DefineConstants>TRACE</DefineConstants>
3247
<ErrorReport>prompt</ErrorReport>
3348
<WarningLevel>4</WarningLevel>
49+
<Prefer32Bit>true</Prefer32Bit>
3450
</PropertyGroup>
3551
<PropertyGroup>
3652
<StartupObject />
@@ -53,6 +69,18 @@
5369
<ItemGroup>
5470
<None Include="App.config" />
5571
</ItemGroup>
72+
<ItemGroup>
73+
<BootstrapperPackage Include=".NETFramework,Version=v4.7">
74+
<Visible>False</Visible>
75+
<ProductName>Microsoft .NET Framework 4.7 %28x86 and x64%29</ProductName>
76+
<Install>true</Install>
77+
</BootstrapperPackage>
78+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
79+
<Visible>False</Visible>
80+
<ProductName>.NET Framework 3.5 SP1</ProductName>
81+
<Install>false</Install>
82+
</BootstrapperPackage>
83+
</ItemGroup>
5684
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5785
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5886
Other similar extension points exist, see Microsoft.Common.targets.

windows/client/OctopusClient/OctopusClient.csproj.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<PublishUrlHistory />
4+
<PublishUrlHistory>publish\</PublishUrlHistory>
55
<InstallUrlHistory />
66
<SupportUrlHistory />
77
<UpdateUrlHistory />

windows/client/OctopusClient/Program.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,16 @@ public void Run(byte clientId, string key) {
219219
type = encreader.ReadUInt16();
220220
code = encreader.ReadUInt16();
221221
value = encreader.ReadInt32();
222+
encreader.Close();
222223
}
223224
else if (enc == 0) {
224225
UInt32 rnd = reader.ReadUInt32();
225226
type = reader.ReadUInt16();
226227
code = reader.ReadUInt16();
227228
value = reader.ReadInt32();
228229
}
229-
else continue;
230+
231+
reader.Close();
230232

231233
//Console.WriteLine("Type:" + type + " Code:" + code + " Value:" + value);
232234
//continue;
@@ -239,8 +241,12 @@ public void Run(byte clientId, string key) {
239241
}
240242
}
241243
else if (type == (uint)LinuxEventTypes.EV_KEY) {
244+
242245
if (code >= (uint)UsefulConst.BTN_MIN && code <= (uint)UsefulConst.BTN_MAX) {
243246
// Mouse Buttons
247+
248+
if (value == 2) continue; // Don't send repeats
249+
244250
if (code == (uint)UsefulConst.BTN_LEFT) {
245251
StackMouseInput(0, 0, 0, value > 0 ? (uint)MouseEventFlags.MOUSEEVENTF_LEFTDOWN
246252
: (uint)MouseEventFlags.MOUSEEVENTF_LEFTUP);
@@ -301,8 +307,20 @@ public void Run(byte clientId, string key) {
301307
class Program
302308
{
303309
static void Main(string[] args) {
310+
// Defaults
311+
byte clientNum = 1;
312+
string encKey = "octopus";
313+
314+
if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) {
315+
clientNum = byte.Parse(args[0]);
316+
}
317+
318+
if (args.Length > 1 && !string.IsNullOrEmpty(args[1])) {
319+
encKey = args[1];
320+
}
321+
304322
OctopusClient octopusClient = new OctopusClient();
305-
octopusClient.Run(byte.Parse(args[0]), args[1]);
323+
octopusClient.Run(clientNum, encKey);
306324
}
307325
}
308326
}

0 commit comments

Comments
 (0)