Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/dotSwitcher/v18/.suo
Binary file not shown.
12 changes: 12 additions & 0 deletions .vs/dotSwitcher/v18/DocumentLayout.backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\Idzumiko\\Documents\\GitHub\\dotSwitcher\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
12 changes: 12 additions & 0 deletions .vs/dotSwitcher/v18/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\Idzumiko\\Documents\\GitHub\\dotSwitcher\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
2 changes: 1 addition & 1 deletion App.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
4 changes: 2 additions & 2 deletions Properties/Resources.Designer.cs

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

11 changes: 7 additions & 4 deletions Switcher/Switcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ private void OnKeyPress(KeyboardEventArgs evtData)
if (evtData.Equals(settings.ConvertSelectionHotkey))
{
ConvertSelection();
evtData.Handled = true;
return;
}

if (this.HaveTrackingKeys(evtData))
Expand Down Expand Up @@ -206,32 +208,33 @@ private void ConvertSelection()
{
LowLevelAdapter.BackupClipboard();
LowLevelAdapter.SendCopy();
Thread.Sleep(settings.SwitchDelay);
var selection = Clipboard.GetText();
LowLevelAdapter.RestoreClipboard();
if (String.IsNullOrEmpty(selection))
{
return;
}


LowLevelAdapter.ReleasePressedFnKeys();

var keys = new List<Keys>(selection.Length);
for(var i = 0; i < selection.Length; i++)
for (var i = 0; i < selection.Length; i++)
{
keys.Add(LowLevelAdapter.ToKey(selection[i]));
}

LowLevelAdapter.SendKeyPress(Keys.Delete, false);
LowLevelAdapter.SetNextKeyboardLayout();
Thread.Sleep(settings.SwitchDelay);

foreach (var key in keys)
{
Debug.Write(key);
if (key != Keys.None)
{
LowLevelAdapter.SendKeyPress(key, (key & Keys.Shift) != Keys.None);
}
}

}
private void SwitchLayout()
{
Expand Down
Loading