Skip to content

Commit

Permalink
Update 1.3.7.0
Browse files Browse the repository at this point in the history
Add macro text box, allow minimizing
  • Loading branch information
jlaundry committed Aug 14, 2021
1 parent 60e7804 commit 264ba03
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 50 deletions.
29 changes: 26 additions & 3 deletions TypeClipboard/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions TypeClipboard/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,10 @@ private void chkHotkey_CheckedChanged(object sender, EventArgs e)

Properties.Settings.Default.Save();
}

private void button2_Click(object sender, EventArgs e)
{
_tc.Type(textBox2.Text);
}
}
}
6 changes: 3 additions & 3 deletions TypeClipboard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jed Laundry")]
[assembly: AssemblyProduct("Type Clipboard")]
[assembly: AssemblyCopyright("Copyright © Jed Laundry, 2020")]
[assembly: AssemblyCopyright("Copyright © Jed Laundry, 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,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.3.6.0")]
[assembly: AssemblyFileVersion("1.3.6.0")]
[assembly: AssemblyVersion("1.3.7.0")]
[assembly: AssemblyFileVersion("1.3.7.0")]
87 changes: 46 additions & 41 deletions TypeClipboard/Typer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,57 @@ class Typer
{
private const int INTERKEY_DELAY = 20;

public void Type(String str, int delay = 2000)
{
Thread.Sleep(delay);
foreach (Char c in str.ToCharArray())
{
// Some characters have special meaning
// https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/sendkeys-statement
switch (c)
{
case '\n':
return;
case '\r':
return;
case '{':
SendKeys.Send("{{}");
break;
case '}':
SendKeys.Send("{}}");
break;
case '+':
SendKeys.Send("{+}");
break;
case '^':
SendKeys.Send("{^}");
break;
case '%':
SendKeys.Send("{%}");
break;
case '~':
SendKeys.Send("{~}");
break;
case '(':
SendKeys.Send("{(}");
break;
case ')':
SendKeys.Send("{)}");
break;
default:
SendKeys.Send(c.ToString());
break;
}
Thread.Sleep(INTERKEY_DELAY);
}
}

public void TypeClipboard(int delay = 2000)
{
if (Clipboard.ContainsText(TextDataFormat.UnicodeText))
{
String clipboard = Clipboard.GetText(TextDataFormat.UnicodeText);
Thread.Sleep(delay);
foreach (Char c in clipboard.ToCharArray())
{
// Some characters have special meaning
// https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/sendkeys-statement
switch (c)
{
case '\n':
return;
case '\r':
return;
case '{':
SendKeys.Send("{{}");
break;
case '}':
SendKeys.Send("{}}");
break;
case '+':
SendKeys.Send("{+}");
break;
case '^':
SendKeys.Send("{^}");
break;
case '%':
SendKeys.Send("{%}");
break;
case '~':
SendKeys.Send("{~}");
break;
case '(':
SendKeys.Send("{(}");
break;
case ')':
SendKeys.Send("{)}");
break;
default:
SendKeys.Send(c.ToString());
break;
}
Thread.Sleep(INTERKEY_DELAY);
}
this.Type(clipboard, delay);
}
}
}
Expand Down
Binary file modified TypeClipboard/typeclipboard.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion TypeClipboardAppx/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity
Name="3373JedLaundry.TypeClipboard"
Publisher="CN=CE320BA0-58BC-4F47-AF5B-94DB661147CC"
Version="1.3.5.0" />
Version="1.3.7.0" />

<Properties>
<DisplayName>TypeClipboard</DisplayName>
Expand Down
3 changes: 1 addition & 2 deletions TypeClipboardAppx/TypeClipboardAppx.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
<AppInstallerUri>C:\temp</AppInstallerUri>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<PackageCertificateThumbprint>F1AC865F3B57360B33C17D9B7ECE4A4BFD2EC9CC</PackageCertificateThumbprint>
<PackageCertificateThumbprint>DFF25B896771BFB75D948AD107C34534A21A08B1</PackageCertificateThumbprint>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AppxBundle>Always</AppxBundle>
Expand Down Expand Up @@ -109,7 +109,6 @@
<Content Include="Images\StoreLogo.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
<None Include="Package.StoreAssociation.xml" />
<None Include="TypeClipboardAppx_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TypeClipboard\TypeClipboard.csproj" />
Expand Down

0 comments on commit 264ba03

Please sign in to comment.