Skip to content

Commit

Permalink
Merge pull request #20 from Terence-D/Dev1.0
Browse files Browse the repository at this point in the history
version 1.1
  • Loading branch information
Terence-D authored Jan 25, 2019
2 parents 257c87c + 3161cb7 commit 25e69bd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion GameInputCommandSystem/GameInputCommandSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<MapFileExtensions>true</MapFileExtensions>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<ApplicationVersion>1.1.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
30 changes: 16 additions & 14 deletions GameInputCommandSystem/KeyMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,24 @@ public bool SendCommand(Command command)
{
return false;
} else {
//if any modifiers, send them first
foreach (string modifier in command.Modifier)
{
AutoItX.Send("{" + modifier + "DOWN}");
if (command.activatorType == Command.KEY_DOWN) {
//if any modifiers, send them first
foreach (string modifier in command.Modifier)
{
AutoItX.Send("{" + modifier + "DOWN}");
}
//now send the key itself
AutoItX.Send("{" + command.Key + " down}");
//keep everything pressed for 10ms
}
//now send the key itself
AutoItX.Send("{" + command.Key + " down}");
//keep everything pressed for 10ms
AutoItX.Sleep(10);
AutoItX.Send("{" + command.Key + " up}");
//if any modifiers, unset them last
foreach (string modifier in command.Modifier)
{
AutoItX.Send("{" + modifier + "UP}");
else if (command.activatorType == Command.KEY_UP) {
AutoItX.Send("{" + command.Key + " up}");
//if any modifiers, unset them last
foreach (string modifier in command.Modifier)
{
AutoItX.Send("{" + modifier + "UP}");
}
}

}
return true;
}
Expand Down
4 changes: 4 additions & 0 deletions GameInputCommandSystem/Models/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ namespace GameInputCommandSystem.Models
{
public class Command
{
public const int KEY_DOWN = 0;
public const int KEY_UP = 1;

public string Key { get; set; }
public string[] Modifier { get; set; }
public int activatorType {get;set;}
}
}
4 changes: 2 additions & 2 deletions GameInputCommandSystem/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

0 comments on commit 25e69bd

Please sign in to comment.