diff --git a/Source/App/App.cs b/Source/App/App.cs index ae6649d..eba887b 100644 --- a/Source/App/App.cs +++ b/Source/App/App.cs @@ -18,6 +18,9 @@ class App { public string CurrentSystemThemeName = null; public List FGWindowHistory = new List(); // needed to detect if Task View was open KeyboardHook KeyboardHooksJumpToDesktop = null; + public uint MostRecentVDDisplayNumber = 0; + KeyboardHook KeyboardHooksJumpToMostRecentDesktop = null; + public static string DetectedVDImplementation = null; @@ -112,6 +115,24 @@ public void SetupHotKeys() { this.KeyboardHooksJumpToDesktop.RegisterHotKey(modifier, key); } } + + if(this.KeyboardHooksJumpToMostRecentDesktop != null) { + this.KeyboardHooksJumpToMostRecentDesktop.Dispose(); + this.KeyboardHooksJumpToMostRecentDesktop = null; + } + + if (this.SettingsForm.UseHotKeyToJumpToMostRecentDesktop()) { + this.KeyboardHooksJumpToMostRecentDesktop= new KeyboardHook(); + this.KeyboardHooksJumpToMostRecentDesktop.KeyPressed += new EventHandler(HotKeyPressed); + ModifierKeys modifier = this.SettingsForm.HotKeysToJumpToDesktop(); + var keys = new List() { + Keys.D0, + Keys.NumPad0 + }; + foreach (var key in keys) { + this.KeyboardHooksJumpToMostRecentDesktop.RegisterHotKey(modifier, key); + } + } } public void HotKeyPressed(object sender, KeyPressedEventArgs e) { @@ -125,6 +146,7 @@ public void HotKeyPressed(object sender, KeyPressedEventArgs e) { else if (e.Key == Keys.D7 || e.Key == Keys.NumPad7) desktopNumber = 7; else if (e.Key == Keys.D8 || e.Key == Keys.NumPad8) desktopNumber = 8; else if (e.Key == Keys.D9 || e.Key == Keys.NumPad9) desktopNumber = 9; + else if (e.Key == Keys.D0 || e.Key == Keys.NumPad0) desktopNumber = (int) this.MostRecentVDDisplayNumber + 1; if(desktopNumber != null) this.SwitchToDesktop(desktopNumber.Value - 1); } @@ -166,6 +188,7 @@ private void _MonitorVDSwitch() { if (newVDDisplayNumber != this.CurrentVDDisplayNumber) { //Util.Logging.WriteLine("Switched to " + newVDDisplayName); this.CurrentVDDisplayName = this.GetVDDisplayName(false); + this.MostRecentVDDisplayNumber = this.CurrentVDDisplayNumber; this.CurrentVDDisplayNumber = newVDDisplayNumber; VDSwitched(); } diff --git a/Source/Forms/SettingsForm.Designer.cs b/Source/Forms/SettingsForm.Designer.cs index f01c47d..50685cf 100644 --- a/Source/Forms/SettingsForm.Designer.cs +++ b/Source/Forms/SettingsForm.Designer.cs @@ -67,6 +67,7 @@ private void InitializeComponent() { this.groupBox2 = new System.Windows.Forms.GroupBox(); this.checkBoxStartupWithWindows = new System.Windows.Forms.CheckBox(); this.notifyIconName = new System.Windows.Forms.NotifyIcon(this.components); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop = new System.Windows.Forms.CheckBox(); this.contextMenuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.panel3.SuspendLayout(); @@ -92,34 +93,34 @@ private void InitializeComponent() { this.toolStripMenuItemSettings, this.toolStripMenuItemExit}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(271, 186); + this.contextMenuStrip1.Size = new System.Drawing.Size(149, 132); this.contextMenuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip1_ItemClicked); // // toolStripMenuItemAbout // this.toolStripMenuItemAbout.Name = "toolStripMenuItemAbout"; - this.toolStripMenuItemAbout.Size = new System.Drawing.Size(270, 36); + this.toolStripMenuItemAbout.Size = new System.Drawing.Size(148, 32); this.toolStripMenuItemAbout.Tag = "about"; this.toolStripMenuItemAbout.Text = "About"; // // toolStripMenuItemDonate // this.toolStripMenuItemDonate.Name = "toolStripMenuItemDonate"; - this.toolStripMenuItemDonate.Size = new System.Drawing.Size(270, 36); + this.toolStripMenuItemDonate.Size = new System.Drawing.Size(148, 32); this.toolStripMenuItemDonate.Tag = "donate"; this.toolStripMenuItemDonate.Text = "Donate"; // // toolStripMenuItemSettings // this.toolStripMenuItemSettings.Name = "toolStripMenuItemSettings"; - this.toolStripMenuItemSettings.Size = new System.Drawing.Size(270, 36); + this.toolStripMenuItemSettings.Size = new System.Drawing.Size(148, 32); this.toolStripMenuItemSettings.Tag = "settings"; this.toolStripMenuItemSettings.Text = "Settings"; // // toolStripMenuItemExit // this.toolStripMenuItemExit.Name = "toolStripMenuItemExit"; - this.toolStripMenuItemExit.Size = new System.Drawing.Size(270, 36); + this.toolStripMenuItemExit.Size = new System.Drawing.Size(148, 32); this.toolStripMenuItemExit.Tag = "exit"; this.toolStripMenuItemExit.Text = "Exit"; // @@ -140,10 +141,10 @@ private void InitializeComponent() { // checkBoxShowPrevNextIcons // this.checkBoxShowPrevNextIcons.AutoSize = true; - this.checkBoxShowPrevNextIcons.Location = new System.Drawing.Point(28, 35); - this.checkBoxShowPrevNextIcons.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxShowPrevNextIcons.Location = new System.Drawing.Point(23, 29); + this.checkBoxShowPrevNextIcons.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxShowPrevNextIcons.Name = "checkBoxShowPrevNextIcons"; - this.checkBoxShowPrevNextIcons.Size = new System.Drawing.Size(409, 29); + this.checkBoxShowPrevNextIcons.Size = new System.Drawing.Size(332, 24); this.checkBoxShowPrevNextIcons.TabIndex = 1; this.checkBoxShowPrevNextIcons.Text = "Show Previous / Next Desktop in Icon Tray"; this.checkBoxShowPrevNextIcons.UseVisualStyleBackColor = true; @@ -151,6 +152,7 @@ private void InitializeComponent() { // // groupBox1 // + this.groupBox1.Controls.Add(this.checkBoxUseHotKeyToJumpToMostRecentDesktop); this.groupBox1.Controls.Add(this.panel3); this.groupBox1.Controls.Add(this.checkBoxUseHotKeysToJumpToDesktop); this.groupBox1.Controls.Add(this.checkBoxOverlayShowOnAllMonitors); @@ -163,11 +165,11 @@ private void InitializeComponent() { this.groupBox1.Controls.Add(this.checkBoxOverlayAnimate); this.groupBox1.Controls.Add(this.checkBoxShowOverlay); this.groupBox1.Controls.Add(this.checkBoxShowPrevNextIcons); - this.groupBox1.Location = new System.Drawing.Point(22, 22); - this.groupBox1.Margin = new System.Windows.Forms.Padding(6); + this.groupBox1.Location = new System.Drawing.Point(18, 3); + this.groupBox1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(6); - this.groupBox1.Size = new System.Drawing.Size(757, 567); + this.groupBox1.Padding = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.groupBox1.Size = new System.Drawing.Size(619, 501); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Features"; @@ -178,19 +180,19 @@ private void InitializeComponent() { this.panel3.Controls.Add(this.radioButtonUseHotKeysToJumpToDesktopAltShift); this.panel3.Controls.Add(this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt); this.panel3.Controls.Add(this.radioButtonUseHotKeysToJumpToDesktopCtrl); - this.panel3.Location = new System.Drawing.Point(73, 509); - this.panel3.Margin = new System.Windows.Forms.Padding(6); + this.panel3.Location = new System.Drawing.Point(60, 424); + this.panel3.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(660, 46); + this.panel3.Size = new System.Drawing.Size(540, 38); this.panel3.TabIndex = 20; // // radioButtonUseHotKeysToJumpToDesktopAlt // this.radioButtonUseHotKeysToJumpToDesktopAlt.AutoSize = true; - this.radioButtonUseHotKeysToJumpToDesktopAlt.Location = new System.Drawing.Point(9, 9); - this.radioButtonUseHotKeysToJumpToDesktopAlt.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonUseHotKeysToJumpToDesktopAlt.Location = new System.Drawing.Point(7, 8); + this.radioButtonUseHotKeysToJumpToDesktopAlt.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonUseHotKeysToJumpToDesktopAlt.Name = "radioButtonUseHotKeysToJumpToDesktopAlt"; - this.radioButtonUseHotKeysToJumpToDesktopAlt.Size = new System.Drawing.Size(83, 29); + this.radioButtonUseHotKeysToJumpToDesktopAlt.Size = new System.Drawing.Size(71, 24); this.radioButtonUseHotKeysToJumpToDesktopAlt.TabIndex = 9; this.radioButtonUseHotKeysToJumpToDesktopAlt.TabStop = true; this.radioButtonUseHotKeysToJumpToDesktopAlt.Text = "Alt+#"; @@ -200,10 +202,10 @@ private void InitializeComponent() { // radioButtonUseHotKeysToJumpToDesktopAltShift // this.radioButtonUseHotKeysToJumpToDesktopAltShift.AutoSize = true; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Location = new System.Drawing.Point(343, 9); - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Location = new System.Drawing.Point(281, 8); + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonUseHotKeysToJumpToDesktopAltShift.Name = "radioButtonUseHotKeysToJumpToDesktopAltShift"; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Size = new System.Drawing.Size(134, 29); + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Size = new System.Drawing.Size(113, 24); this.radioButtonUseHotKeysToJumpToDesktopAltShift.TabIndex = 8; this.radioButtonUseHotKeysToJumpToDesktopAltShift.TabStop = true; this.radioButtonUseHotKeysToJumpToDesktopAltShift.Text = "Alt+Shift+#"; @@ -213,10 +215,10 @@ private void InitializeComponent() { // radioButtonUseHotKeysToJumpToDesktopCtrlAlt // this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.AutoSize = true; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Location = new System.Drawing.Point(206, 9); - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Location = new System.Drawing.Point(169, 8); + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Name = "radioButtonUseHotKeysToJumpToDesktopCtrlAlt"; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Size = new System.Drawing.Size(125, 29); + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Size = new System.Drawing.Size(104, 24); this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.TabIndex = 7; this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.TabStop = true; this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Text = "Ctrl+Alt+#"; @@ -226,10 +228,10 @@ private void InitializeComponent() { // radioButtonUseHotKeysToJumpToDesktopCtrl // this.radioButtonUseHotKeysToJumpToDesktopCtrl.AutoSize = true; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.Location = new System.Drawing.Point(104, 9); - this.radioButtonUseHotKeysToJumpToDesktopCtrl.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Location = new System.Drawing.Point(85, 8); + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonUseHotKeysToJumpToDesktopCtrl.Name = "radioButtonUseHotKeysToJumpToDesktopCtrl"; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.Size = new System.Drawing.Size(90, 29); + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Size = new System.Drawing.Size(76, 24); this.radioButtonUseHotKeysToJumpToDesktopCtrl.TabIndex = 6; this.radioButtonUseHotKeysToJumpToDesktopCtrl.TabStop = true; this.radioButtonUseHotKeysToJumpToDesktopCtrl.Text = "Ctrl+#"; @@ -239,10 +241,10 @@ private void InitializeComponent() { // checkBoxUseHotKeysToJumpToDesktop // this.checkBoxUseHotKeysToJumpToDesktop.AutoSize = true; - this.checkBoxUseHotKeysToJumpToDesktop.Location = new System.Drawing.Point(28, 482); - this.checkBoxUseHotKeysToJumpToDesktop.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxUseHotKeysToJumpToDesktop.Location = new System.Drawing.Point(23, 402); + this.checkBoxUseHotKeysToJumpToDesktop.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxUseHotKeysToJumpToDesktop.Name = "checkBoxUseHotKeysToJumpToDesktop"; - this.checkBoxUseHotKeysToJumpToDesktop.Size = new System.Drawing.Size(331, 29); + this.checkBoxUseHotKeysToJumpToDesktop.Size = new System.Drawing.Size(275, 24); this.checkBoxUseHotKeysToJumpToDesktop.TabIndex = 23; this.checkBoxUseHotKeysToJumpToDesktop.Text = "Use Hot Keys to Jump to Desktop"; this.checkBoxUseHotKeysToJumpToDesktop.UseVisualStyleBackColor = true; @@ -251,10 +253,10 @@ private void InitializeComponent() { // checkBoxOverlayShowOnAllMonitors // this.checkBoxOverlayShowOnAllMonitors.AutoSize = true; - this.checkBoxOverlayShowOnAllMonitors.Location = new System.Drawing.Point(78, 245); - this.checkBoxOverlayShowOnAllMonitors.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxOverlayShowOnAllMonitors.Location = new System.Drawing.Point(64, 204); + this.checkBoxOverlayShowOnAllMonitors.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxOverlayShowOnAllMonitors.Name = "checkBoxOverlayShowOnAllMonitors"; - this.checkBoxOverlayShowOnAllMonitors.Size = new System.Drawing.Size(219, 29); + this.checkBoxOverlayShowOnAllMonitors.Size = new System.Drawing.Size(181, 24); this.checkBoxOverlayShowOnAllMonitors.TabIndex = 22; this.checkBoxOverlayShowOnAllMonitors.Text = "Show on all Monitors"; this.checkBoxOverlayShowOnAllMonitors.UseVisualStyleBackColor = true; @@ -263,10 +265,10 @@ private void InitializeComponent() { // checkBoxShowDesktopNameInitial // this.checkBoxShowDesktopNameInitial.AutoSize = true; - this.checkBoxShowDesktopNameInitial.Location = new System.Drawing.Point(28, 441); - this.checkBoxShowDesktopNameInitial.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxShowDesktopNameInitial.Location = new System.Drawing.Point(23, 368); + this.checkBoxShowDesktopNameInitial.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxShowDesktopNameInitial.Name = "checkBoxShowDesktopNameInitial"; - this.checkBoxShowDesktopNameInitial.Size = new System.Drawing.Size(378, 29); + this.checkBoxShowDesktopNameInitial.Size = new System.Drawing.Size(311, 24); this.checkBoxShowDesktopNameInitial.TabIndex = 21; this.checkBoxShowDesktopNameInitial.Text = "Show Desktop Name Initial in Icon Tray"; this.checkBoxShowDesktopNameInitial.UseVisualStyleBackColor = true; @@ -275,10 +277,10 @@ private void InitializeComponent() { // checkBoxClickDesktopNumberTaskView // this.checkBoxClickDesktopNumberTaskView.AutoSize = true; - this.checkBoxClickDesktopNumberTaskView.Location = new System.Drawing.Point(28, 400); - this.checkBoxClickDesktopNumberTaskView.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxClickDesktopNumberTaskView.Location = new System.Drawing.Point(23, 333); + this.checkBoxClickDesktopNumberTaskView.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxClickDesktopNumberTaskView.Name = "checkBoxClickDesktopNumberTaskView"; - this.checkBoxClickDesktopNumberTaskView.Size = new System.Drawing.Size(521, 29); + this.checkBoxClickDesktopNumberTaskView.Size = new System.Drawing.Size(422, 24); this.checkBoxClickDesktopNumberTaskView.TabIndex = 20; this.checkBoxClickDesktopNumberTaskView.Text = "Clicking Desktop Number in Icon Tray opens Task View"; this.checkBoxClickDesktopNumberTaskView.UseVisualStyleBackColor = true; @@ -290,19 +292,19 @@ private void InitializeComponent() { this.panel2.Controls.Add(this.radioButtonOverlayLongDuration); this.panel2.Controls.Add(this.radioButtonOverlayMediumDuration); this.panel2.Controls.Add(this.radioButtonOverlayShortDuration); - this.panel2.Location = new System.Drawing.Point(73, 114); - this.panel2.Margin = new System.Windows.Forms.Padding(6); + this.panel2.Location = new System.Drawing.Point(60, 95); + this.panel2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(660, 46); + this.panel2.Size = new System.Drawing.Size(540, 38); this.panel2.TabIndex = 19; // // radioButtonOverlayMicroDuration // this.radioButtonOverlayMicroDuration.AutoSize = true; - this.radioButtonOverlayMicroDuration.Location = new System.Drawing.Point(9, 9); - this.radioButtonOverlayMicroDuration.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonOverlayMicroDuration.Location = new System.Drawing.Point(7, 8); + this.radioButtonOverlayMicroDuration.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonOverlayMicroDuration.Name = "radioButtonOverlayMicroDuration"; - this.radioButtonOverlayMicroDuration.Size = new System.Drawing.Size(96, 29); + this.radioButtonOverlayMicroDuration.Size = new System.Drawing.Size(82, 24); this.radioButtonOverlayMicroDuration.TabIndex = 9; this.radioButtonOverlayMicroDuration.TabStop = true; this.radioButtonOverlayMicroDuration.Text = "500ms"; @@ -311,10 +313,10 @@ private void InitializeComponent() { // radioButtonOverlayLongDuration // this.radioButtonOverlayLongDuration.AutoSize = true; - this.radioButtonOverlayLongDuration.Location = new System.Drawing.Point(372, 9); - this.radioButtonOverlayLongDuration.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonOverlayLongDuration.Location = new System.Drawing.Point(304, 8); + this.radioButtonOverlayLongDuration.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonOverlayLongDuration.Name = "radioButtonOverlayLongDuration"; - this.radioButtonOverlayLongDuration.Size = new System.Drawing.Size(107, 29); + this.radioButtonOverlayLongDuration.Size = new System.Drawing.Size(91, 24); this.radioButtonOverlayLongDuration.TabIndex = 8; this.radioButtonOverlayLongDuration.TabStop = true; this.radioButtonOverlayLongDuration.Text = "3000ms"; @@ -323,10 +325,10 @@ private void InitializeComponent() { // radioButtonOverlayMediumDuration // this.radioButtonOverlayMediumDuration.AutoSize = true; - this.radioButtonOverlayMediumDuration.Location = new System.Drawing.Point(251, 9); - this.radioButtonOverlayMediumDuration.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonOverlayMediumDuration.Location = new System.Drawing.Point(205, 8); + this.radioButtonOverlayMediumDuration.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonOverlayMediumDuration.Name = "radioButtonOverlayMediumDuration"; - this.radioButtonOverlayMediumDuration.Size = new System.Drawing.Size(107, 29); + this.radioButtonOverlayMediumDuration.Size = new System.Drawing.Size(91, 24); this.radioButtonOverlayMediumDuration.TabIndex = 7; this.radioButtonOverlayMediumDuration.TabStop = true; this.radioButtonOverlayMediumDuration.Text = "2000ms"; @@ -335,10 +337,10 @@ private void InitializeComponent() { // radioButtonOverlayShortDuration // this.radioButtonOverlayShortDuration.AutoSize = true; - this.radioButtonOverlayShortDuration.Location = new System.Drawing.Point(127, 9); - this.radioButtonOverlayShortDuration.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonOverlayShortDuration.Location = new System.Drawing.Point(104, 8); + this.radioButtonOverlayShortDuration.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonOverlayShortDuration.Name = "radioButtonOverlayShortDuration"; - this.radioButtonOverlayShortDuration.Size = new System.Drawing.Size(107, 29); + this.radioButtonOverlayShortDuration.Size = new System.Drawing.Size(91, 24); this.radioButtonOverlayShortDuration.TabIndex = 6; this.radioButtonOverlayShortDuration.TabStop = true; this.radioButtonOverlayShortDuration.Text = "1000ms"; @@ -355,17 +357,17 @@ private void InitializeComponent() { this.panel1.Controls.Add(this.radioButtonPositionTopRight); this.panel1.Controls.Add(this.radioButtonPositionTopCenter); this.panel1.Controls.Add(this.radioButtonPositionTopLeft); - this.panel1.Location = new System.Drawing.Point(160, 280); - this.panel1.Margin = new System.Windows.Forms.Padding(6); + this.panel1.Location = new System.Drawing.Point(131, 233); + this.panel1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(114, 109); + this.panel1.Size = new System.Drawing.Size(93, 91); this.panel1.TabIndex = 18; // // radioButtonPositionBottomRight // this.radioButtonPositionBottomRight.AutoSize = true; - this.radioButtonPositionBottomRight.Location = new System.Drawing.Point(79, 76); - this.radioButtonPositionBottomRight.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionBottomRight.Location = new System.Drawing.Point(65, 63); + this.radioButtonPositionBottomRight.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionBottomRight.Name = "radioButtonPositionBottomRight"; this.radioButtonPositionBottomRight.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionBottomRight.TabIndex = 26; @@ -375,8 +377,8 @@ private void InitializeComponent() { // radioButtonPositionBottomCenter // this.radioButtonPositionBottomCenter.AutoSize = true; - this.radioButtonPositionBottomCenter.Location = new System.Drawing.Point(42, 76); - this.radioButtonPositionBottomCenter.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionBottomCenter.Location = new System.Drawing.Point(34, 63); + this.radioButtonPositionBottomCenter.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionBottomCenter.Name = "radioButtonPositionBottomCenter"; this.radioButtonPositionBottomCenter.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionBottomCenter.TabIndex = 25; @@ -386,8 +388,8 @@ private void InitializeComponent() { // radioButtonPositionBottomLeft // this.radioButtonPositionBottomLeft.AutoSize = true; - this.radioButtonPositionBottomLeft.Location = new System.Drawing.Point(6, 76); - this.radioButtonPositionBottomLeft.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionBottomLeft.Location = new System.Drawing.Point(5, 63); + this.radioButtonPositionBottomLeft.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionBottomLeft.Name = "radioButtonPositionBottomLeft"; this.radioButtonPositionBottomLeft.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionBottomLeft.TabIndex = 24; @@ -397,8 +399,8 @@ private void InitializeComponent() { // radioButtonPositionMiddleRight // this.radioButtonPositionMiddleRight.AutoSize = true; - this.radioButtonPositionMiddleRight.Location = new System.Drawing.Point(79, 41); - this.radioButtonPositionMiddleRight.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionMiddleRight.Location = new System.Drawing.Point(65, 34); + this.radioButtonPositionMiddleRight.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionMiddleRight.Name = "radioButtonPositionMiddleRight"; this.radioButtonPositionMiddleRight.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionMiddleRight.TabIndex = 23; @@ -408,8 +410,8 @@ private void InitializeComponent() { // radioButtonPositionMiddleCenter // this.radioButtonPositionMiddleCenter.AutoSize = true; - this.radioButtonPositionMiddleCenter.Location = new System.Drawing.Point(42, 41); - this.radioButtonPositionMiddleCenter.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionMiddleCenter.Location = new System.Drawing.Point(34, 34); + this.radioButtonPositionMiddleCenter.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionMiddleCenter.Name = "radioButtonPositionMiddleCenter"; this.radioButtonPositionMiddleCenter.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionMiddleCenter.TabIndex = 22; @@ -419,8 +421,8 @@ private void InitializeComponent() { // radioButtonPositionMiddleLeft // this.radioButtonPositionMiddleLeft.AutoSize = true; - this.radioButtonPositionMiddleLeft.Location = new System.Drawing.Point(6, 41); - this.radioButtonPositionMiddleLeft.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionMiddleLeft.Location = new System.Drawing.Point(5, 34); + this.radioButtonPositionMiddleLeft.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionMiddleLeft.Name = "radioButtonPositionMiddleLeft"; this.radioButtonPositionMiddleLeft.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionMiddleLeft.TabIndex = 21; @@ -430,8 +432,8 @@ private void InitializeComponent() { // radioButtonPositionTopRight // this.radioButtonPositionTopRight.AutoSize = true; - this.radioButtonPositionTopRight.Location = new System.Drawing.Point(79, 6); - this.radioButtonPositionTopRight.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionTopRight.Location = new System.Drawing.Point(65, 5); + this.radioButtonPositionTopRight.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionTopRight.Name = "radioButtonPositionTopRight"; this.radioButtonPositionTopRight.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionTopRight.TabIndex = 20; @@ -441,8 +443,8 @@ private void InitializeComponent() { // radioButtonPositionTopCenter // this.radioButtonPositionTopCenter.AutoSize = true; - this.radioButtonPositionTopCenter.Location = new System.Drawing.Point(42, 6); - this.radioButtonPositionTopCenter.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionTopCenter.Location = new System.Drawing.Point(34, 5); + this.radioButtonPositionTopCenter.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionTopCenter.Name = "radioButtonPositionTopCenter"; this.radioButtonPositionTopCenter.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionTopCenter.TabIndex = 19; @@ -452,8 +454,8 @@ private void InitializeComponent() { // radioButtonPositionTopLeft // this.radioButtonPositionTopLeft.AutoSize = true; - this.radioButtonPositionTopLeft.Location = new System.Drawing.Point(6, 6); - this.radioButtonPositionTopLeft.Margin = new System.Windows.Forms.Padding(6); + this.radioButtonPositionTopLeft.Location = new System.Drawing.Point(5, 5); + this.radioButtonPositionTopLeft.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.radioButtonPositionTopLeft.Name = "radioButtonPositionTopLeft"; this.radioButtonPositionTopLeft.Size = new System.Drawing.Size(21, 20); this.radioButtonPositionTopLeft.TabIndex = 18; @@ -463,20 +465,20 @@ private void InitializeComponent() { // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(73, 283); - this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label1.Location = new System.Drawing.Point(60, 236); + this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(87, 25); + this.label1.Size = new System.Drawing.Size(69, 20); this.label1.TabIndex = 9; this.label1.Text = "Position:"; // // checkBoxOverlayTranslucent // this.checkBoxOverlayTranslucent.AutoSize = true; - this.checkBoxOverlayTranslucent.Location = new System.Drawing.Point(79, 205); - this.checkBoxOverlayTranslucent.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxOverlayTranslucent.Location = new System.Drawing.Point(65, 171); + this.checkBoxOverlayTranslucent.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxOverlayTranslucent.Name = "checkBoxOverlayTranslucent"; - this.checkBoxOverlayTranslucent.Size = new System.Drawing.Size(141, 29); + this.checkBoxOverlayTranslucent.Size = new System.Drawing.Size(118, 24); this.checkBoxOverlayTranslucent.TabIndex = 7; this.checkBoxOverlayTranslucent.Text = "Translucent"; this.checkBoxOverlayTranslucent.UseVisualStyleBackColor = true; @@ -484,10 +486,10 @@ private void InitializeComponent() { // checkBoxOverlayAnimate // this.checkBoxOverlayAnimate.AutoSize = true; - this.checkBoxOverlayAnimate.Location = new System.Drawing.Point(79, 162); - this.checkBoxOverlayAnimate.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxOverlayAnimate.Location = new System.Drawing.Point(65, 135); + this.checkBoxOverlayAnimate.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxOverlayAnimate.Name = "checkBoxOverlayAnimate"; - this.checkBoxOverlayAnimate.Size = new System.Drawing.Size(169, 29); + this.checkBoxOverlayAnimate.Size = new System.Drawing.Size(142, 24); this.checkBoxOverlayAnimate.TabIndex = 6; this.checkBoxOverlayAnimate.Text = "Animate In/Out"; this.checkBoxOverlayAnimate.UseVisualStyleBackColor = true; @@ -495,10 +497,10 @@ private void InitializeComponent() { // checkBoxShowOverlay // this.checkBoxShowOverlay.AutoSize = true; - this.checkBoxShowOverlay.Location = new System.Drawing.Point(28, 78); - this.checkBoxShowOverlay.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxShowOverlay.Location = new System.Drawing.Point(23, 65); + this.checkBoxShowOverlay.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxShowOverlay.Name = "checkBoxShowOverlay"; - this.checkBoxShowOverlay.Size = new System.Drawing.Size(375, 29); + this.checkBoxShowOverlay.Size = new System.Drawing.Size(306, 24); this.checkBoxShowOverlay.TabIndex = 2; this.checkBoxShowOverlay.Text = "Show Overlay when switching Desktop"; this.checkBoxShowOverlay.UseVisualStyleBackColor = true; @@ -507,11 +509,11 @@ private void InitializeComponent() { // groupBox2 // this.groupBox2.Controls.Add(this.checkBoxStartupWithWindows); - this.groupBox2.Location = new System.Drawing.Point(22, 601); - this.groupBox2.Margin = new System.Windows.Forms.Padding(6); + this.groupBox2.Location = new System.Drawing.Point(18, 506); + this.groupBox2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Padding = new System.Windows.Forms.Padding(6); - this.groupBox2.Size = new System.Drawing.Size(757, 89); + this.groupBox2.Padding = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.groupBox2.Size = new System.Drawing.Size(619, 74); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "Settings"; @@ -519,10 +521,10 @@ private void InitializeComponent() { // checkBoxStartupWithWindows // this.checkBoxStartupWithWindows.AutoSize = true; - this.checkBoxStartupWithWindows.Location = new System.Drawing.Point(28, 35); - this.checkBoxStartupWithWindows.Margin = new System.Windows.Forms.Padding(6); + this.checkBoxStartupWithWindows.Location = new System.Drawing.Point(23, 29); + this.checkBoxStartupWithWindows.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.checkBoxStartupWithWindows.Name = "checkBoxStartupWithWindows"; - this.checkBoxStartupWithWindows.Size = new System.Drawing.Size(226, 29); + this.checkBoxStartupWithWindows.Size = new System.Drawing.Size(188, 24); this.checkBoxStartupWithWindows.TabIndex = 1; this.checkBoxStartupWithWindows.Text = "Startup with Windows"; this.checkBoxStartupWithWindows.UseVisualStyleBackColor = true; @@ -536,15 +538,26 @@ private void InitializeComponent() { this.notifyIconName.Visible = true; this.notifyIconName.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIconName_MouseClick); // + // checkBoxUseHotKeyToJumpToMostRecentDesktop + // + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.AutoSize = true; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Location = new System.Drawing.Point(23, 467); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Margin = new System.Windows.Forms.Padding(5); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Name = "checkBoxUseHotKeyToJumpToMostRecentDesktop"; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Size = new System.Drawing.Size(458, 24); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.TabIndex = 24; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Text = "Use Hot Key (Modifier + 0) to Jump to Most Recent Desktop"; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.UseVisualStyleBackColor = true; + // // SettingsForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(805, 713); + this.ClientSize = new System.Drawing.Size(659, 594); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Margin = new System.Windows.Forms.Padding(6); + this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "SettingsForm"; @@ -611,5 +624,6 @@ private void InitializeComponent() { private System.Windows.Forms.RadioButton radioButtonUseHotKeysToJumpToDesktopCtrlAlt; private System.Windows.Forms.RadioButton radioButtonUseHotKeysToJumpToDesktopCtrl; private System.Windows.Forms.CheckBox checkBoxUseHotKeysToJumpToDesktop; + private System.Windows.Forms.CheckBox checkBoxUseHotKeyToJumpToMostRecentDesktop; } } \ No newline at end of file diff --git a/Source/Forms/SettingsForm.cs b/Source/Forms/SettingsForm.cs index 64c4386..b319a0c 100644 --- a/Source/Forms/SettingsForm.cs +++ b/Source/Forms/SettingsForm.cs @@ -101,6 +101,9 @@ public string OverlayPosition() { else if (this.radioButtonPositionBottomRight.Checked) return "bottomright"; else return "middlecenter"; } + public bool UseHotKeyToJumpToMostRecentDesktop() { + return this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + } private void LoadSettingsIntoUI() { this.checkBoxShowPrevNextIcons.Checked = Properties.Settings.Default.ShowPrevNextIcons; @@ -112,6 +115,7 @@ private void LoadSettingsIntoUI() { this.checkBoxOverlayShowOnAllMonitors.Checked = Properties.Settings.Default.OverlayShowOnAllMonitors; this.checkBoxClickDesktopNumberTaskView.Checked = Properties.Settings.Default.ClickDesktopNumberOpensTaskView; this.checkBoxUseHotKeysToJumpToDesktop.Checked = Properties.Settings.Default.UseHotKeysToJumpToDesktop; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked = Properties.Settings.Default.UseHotKeyToJumpToMostRecentDesktop; this.radioButtonOverlayLongDuration.Checked = Properties.Settings.Default.OverlayDuration == "long"; this.radioButtonOverlayMediumDuration.Checked = Properties.Settings.Default.OverlayDuration == "medium"; this.radioButtonOverlayShortDuration.Checked = Properties.Settings.Default.OverlayDuration == "short"; @@ -131,6 +135,7 @@ private void LoadSettingsIntoUI() { this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Checked = Properties.Settings.Default.HotKeysToJumpToDesktop == "CtrlAlt"; checkBoxShowOverlay_CheckedChanged(this, null); checkBoxUseHotKeysToJumpToDesktop_CheckedChanged(this, null); + checkBoxUseHotKeyToJumpToMostRecentDesktop_CheckedChanged(this, null); } private void SaveSettingsFromUI() { Properties.Settings.Default.ShowPrevNextIcons = this.checkBoxShowPrevNextIcons.Checked; @@ -142,6 +147,7 @@ private void SaveSettingsFromUI() { Properties.Settings.Default.OverlayShowOnAllMonitors = this.checkBoxOverlayShowOnAllMonitors.Checked; Properties.Settings.Default.ClickDesktopNumberOpensTaskView = this.checkBoxClickDesktopNumberTaskView.Checked; Properties.Settings.Default.UseHotKeysToJumpToDesktop = this.checkBoxUseHotKeysToJumpToDesktop.Checked; + Properties.Settings.Default.UseHotKeyToJumpToMostRecentDesktop = this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; if (this.radioButtonOverlayLongDuration.Checked) Properties.Settings.Default.OverlayDuration = "long"; if (this.radioButtonOverlayMediumDuration.Checked) Properties.Settings.Default.OverlayDuration = "medium"; if (this.radioButtonOverlayShortDuration.Checked) Properties.Settings.Default.OverlayDuration = "short"; @@ -318,10 +324,10 @@ private void checkBoxOverlayShowOnAllMonitors_CheckedChanged(object sender, Even } private void checkBoxUseHotKeysToJumpToDesktop_CheckedChanged(object sender, EventArgs e) { - radioButtonUseHotKeysToJumpToDesktopAlt.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked; - radioButtonUseHotKeysToJumpToDesktopAltShift.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked; - radioButtonUseHotKeysToJumpToDesktopCtrl.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked; - radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopAlt.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopAltShift.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopCtrl.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; if(!IsLoading) App.Instance.SetupHotKeys(); } @@ -341,5 +347,14 @@ private void radioButtonUseHotKeysToJumpToDesktopCtrlAlt_CheckedChanged(object s private void radioButtonUseHotKeysToJumpToDesktopAltShift_CheckedChanged(object sender, EventArgs e) { if (!IsLoading) App.Instance.SetupHotKeys(); } + + private void checkBoxUseHotKeyToJumpToMostRecentDesktop_CheckedChanged(object sender, EventArgs e) { + radioButtonUseHotKeysToJumpToDesktopAlt.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopAltShift.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopCtrl.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Enabled = checkBoxUseHotKeysToJumpToDesktop.Checked || checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + + if (!IsLoading) App.Instance.SetupHotKeys(); + } } } diff --git a/Source/Properties/Settings.Designer.cs b/Source/Properties/Settings.Designer.cs index 38b9420..62f49e0 100644 --- a/Source/Properties/Settings.Designer.cs +++ b/Source/Properties/Settings.Designer.cs @@ -165,6 +165,30 @@ public string HotKeysToJumpToDesktop { set { this["HotKeysToJumpToDesktop"] = value; } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool UseHotKeyToJumpToMostRecentDesktop { + get { + return ((bool)(this["UseHotKeyToJumpToMostRecentDesktop"])); + } + set { + this["UseHotKeyToJumpToMostRecentDesktop"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Alt")] + public string HotKeysToJumpToMostRecentDesktop { + get { + return ((string)(this["HotKeysToJumpToMostRecentDesktop"])); + } + set { + this["HotKeysToJumpToMostRecentDesktop"] = value; + } } } } diff --git a/Source/Properties/Settings.settings b/Source/Properties/Settings.settings index 5d9c950..aadc3d1 100644 --- a/Source/Properties/Settings.settings +++ b/Source/Properties/Settings.settings @@ -38,5 +38,8 @@ Alt + + False + \ No newline at end of file diff --git a/Source/app.config b/Source/app.config index 531f680..a57eae3 100644 --- a/Source/app.config +++ b/Source/app.config @@ -49,6 +49,9 @@ Alt + + False +