Skip to content

Commit

Permalink
custom switch hotkey
Browse files Browse the repository at this point in the history
alt+ and win+ are not supported for now
  • Loading branch information
kurumpa committed Feb 7, 2015
1 parent e199bea commit a99af84
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 186 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/bin/*
/obj/*
/*.suo
test.cmd
21 changes: 9 additions & 12 deletions LowLevelAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,17 @@ public static void SendKeyPress(Keys vkCode, bool shift = false)

}

public static bool[] ReleasePressedKeys()
public static void ReleasePressedFnKeys()
{
// temp solution
return new bool[8]
{
ReleasePressedKey(Keys.LMenu, true),
ReleasePressedKey(Keys.RMenu, true),
ReleasePressedKey(Keys.LWin, true),
ReleasePressedKey(Keys.RWin, true),
ReleasePressedKey(Keys.RControlKey, false),
ReleasePressedKey(Keys.LControlKey, false),
ReleasePressedKey(Keys.LShiftKey, false),
ReleasePressedKey(Keys.RShiftKey, false)
};
//ReleasePressedKey(Keys.LMenu, true),
//ReleasePressedKey(Keys.RMenu, true),
//ReleasePressedKey(Keys.LWin, true),
//ReleasePressedKey(Keys.RWin, true),
ReleasePressedKey(Keys.RControlKey, false);
ReleasePressedKey(Keys.LControlKey, false);
ReleasePressedKey(Keys.LShiftKey, false);
ReleasePressedKey(Keys.RShiftKey, false);
}

public static bool ReleasePressedKey(Keys keyCode, bool releaseTwice)
Expand Down
1 change: 0 additions & 1 deletion MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public SysTrayApp(Switcher engine)

trayIcon.ContextMenu = trayMenu;
trayIcon.Visible = true;

}

private void InitSettings()
Expand Down
5 changes: 5 additions & 0 deletions SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ private void shortcutTextBox_KeyUp(object sender, KeyEventArgs e)

private void buttonSave_Click(object sender, EventArgs e)
{
if (settings.SwitchHotkey.Alt || settings.SwitchHotkey.Win)
{
MessageBox.Show("Sorry, win+ and alt+ hotkeys are not supported yet");
return;
}
DialogResult = DialogResult.OK;
Close();
}
Expand Down
Loading

0 comments on commit a99af84

Please sign in to comment.