From 4331edf12c7e15cb76a840a7994b013f29ac8c78 Mon Sep 17 00:00:00 2001 From: Saif Masoud Date: Thu, 25 Jan 2024 13:33:41 -0500 Subject: [PATCH 1/3] Added Hotkey to Jump To Most Recent Desktop & checkbox setting to enable it --- Source/App/App.cs | 23 ++ Source/Forms/SettingsForm.Designer.cs | 322 ++++++++++++-------------- Source/Forms/SettingsForm.cs | 12 + 3 files changed, 186 insertions(+), 171 deletions(-) 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 7aacf63..116af6b 100644 --- a/Source/Forms/SettingsForm.Designer.cs +++ b/Source/Forms/SettingsForm.Designer.cs @@ -36,6 +36,12 @@ private void InitializeComponent() { this.notifyIconNext = new System.Windows.Forms.NotifyIcon(this.components); this.checkBoxShowPrevNextIcons = new System.Windows.Forms.CheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.panel3 = new System.Windows.Forms.Panel(); + this.radioButtonUseHotKeysToJumpToDesktopAlt = new System.Windows.Forms.RadioButton(); + this.radioButtonUseHotKeysToJumpToDesktopAltShift = new System.Windows.Forms.RadioButton(); + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt = new System.Windows.Forms.RadioButton(); + this.radioButtonUseHotKeysToJumpToDesktopCtrl = new System.Windows.Forms.RadioButton(); + this.checkBoxUseHotKeysToJumpToDesktop = new System.Windows.Forms.CheckBox(); this.checkBoxOverlayShowOnAllMonitors = new System.Windows.Forms.CheckBox(); this.checkBoxShowDesktopNameInitial = new System.Windows.Forms.CheckBox(); this.checkBoxClickDesktopNumberTaskView = new System.Windows.Forms.CheckBox(); @@ -61,18 +67,13 @@ 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.checkBoxUseHotKeysToJumpToDesktop = new System.Windows.Forms.CheckBox(); - this.panel3 = new System.Windows.Forms.Panel(); - this.radioButtonUseHotKeysToJumpToDesktopAlt = new System.Windows.Forms.RadioButton(); - this.radioButtonUseHotKeysToJumpToDesktopAltShift = new System.Windows.Forms.RadioButton(); - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt = new System.Windows.Forms.RadioButton(); - this.radioButtonUseHotKeysToJumpToDesktopCtrl = new System.Windows.Forms.RadioButton(); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop = new System.Windows.Forms.CheckBox(); this.contextMenuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); + this.panel3.SuspendLayout(); this.panel2.SuspendLayout(); this.panel1.SuspendLayout(); this.groupBox2.SuspendLayout(); - this.panel3.SuspendLayout(); this.SuspendLayout(); // // notifyIconNumber @@ -92,34 +93,34 @@ private void InitializeComponent() { this.toolStripMenuItemSettings, this.toolStripMenuItemExit}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(161, 148); + this.contextMenuStrip1.Size = new System.Drawing.Size(117, 92); this.contextMenuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip1_ItemClicked); // // toolStripMenuItemAbout // this.toolStripMenuItemAbout.Name = "toolStripMenuItemAbout"; - this.toolStripMenuItemAbout.Size = new System.Drawing.Size(160, 36); + this.toolStripMenuItemAbout.Size = new System.Drawing.Size(116, 22); this.toolStripMenuItemAbout.Tag = "about"; this.toolStripMenuItemAbout.Text = "About"; // // toolStripMenuItemDonate // this.toolStripMenuItemDonate.Name = "toolStripMenuItemDonate"; - this.toolStripMenuItemDonate.Size = new System.Drawing.Size(160, 36); + this.toolStripMenuItemDonate.Size = new System.Drawing.Size(116, 22); this.toolStripMenuItemDonate.Tag = "donate"; this.toolStripMenuItemDonate.Text = "Donate"; // // toolStripMenuItemSettings // this.toolStripMenuItemSettings.Name = "toolStripMenuItemSettings"; - this.toolStripMenuItemSettings.Size = new System.Drawing.Size(160, 36); + this.toolStripMenuItemSettings.Size = new System.Drawing.Size(116, 22); this.toolStripMenuItemSettings.Tag = "settings"; this.toolStripMenuItemSettings.Text = "Settings"; // // toolStripMenuItemExit // this.toolStripMenuItemExit.Name = "toolStripMenuItemExit"; - this.toolStripMenuItemExit.Size = new System.Drawing.Size(160, 36); + this.toolStripMenuItemExit.Size = new System.Drawing.Size(116, 22); this.toolStripMenuItemExit.Tag = "exit"; this.toolStripMenuItemExit.Text = "Exit"; // @@ -140,10 +141,9 @@ 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(15, 19); this.checkBoxShowPrevNextIcons.Name = "checkBoxShowPrevNextIcons"; - this.checkBoxShowPrevNextIcons.Size = new System.Drawing.Size(409, 29); + this.checkBoxShowPrevNextIcons.Size = new System.Drawing.Size(232, 17); this.checkBoxShowPrevNextIcons.TabIndex = 1; this.checkBoxShowPrevNextIcons.Text = "Show Previous / Next Desktop in Icon Tray"; this.checkBoxShowPrevNextIcons.UseVisualStyleBackColor = true; @@ -163,22 +163,89 @@ 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(12, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(6); - this.groupBox1.Size = new System.Drawing.Size(757, 567); + this.groupBox1.Size = new System.Drawing.Size(413, 307); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Features"; // + // panel3 + // + this.panel3.Controls.Add(this.radioButtonUseHotKeysToJumpToDesktopAlt); + 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(40, 276); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(360, 25); + this.panel3.TabIndex = 20; + // + // radioButtonUseHotKeysToJumpToDesktopAlt + // + this.radioButtonUseHotKeysToJumpToDesktopAlt.AutoSize = true; + this.radioButtonUseHotKeysToJumpToDesktopAlt.Location = new System.Drawing.Point(5, 5); + this.radioButtonUseHotKeysToJumpToDesktopAlt.Name = "radioButtonUseHotKeysToJumpToDesktopAlt"; + this.radioButtonUseHotKeysToJumpToDesktopAlt.Size = new System.Drawing.Size(50, 17); + this.radioButtonUseHotKeysToJumpToDesktopAlt.TabIndex = 9; + this.radioButtonUseHotKeysToJumpToDesktopAlt.TabStop = true; + this.radioButtonUseHotKeysToJumpToDesktopAlt.Text = "Alt+#"; + this.radioButtonUseHotKeysToJumpToDesktopAlt.UseVisualStyleBackColor = true; + this.radioButtonUseHotKeysToJumpToDesktopAlt.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopAlt_CheckedChanged); + // + // radioButtonUseHotKeysToJumpToDesktopAltShift + // + this.radioButtonUseHotKeysToJumpToDesktopAltShift.AutoSize = true; + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Location = new System.Drawing.Point(187, 5); + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Name = "radioButtonUseHotKeysToJumpToDesktopAltShift"; + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Size = new System.Drawing.Size(77, 17); + this.radioButtonUseHotKeysToJumpToDesktopAltShift.TabIndex = 8; + this.radioButtonUseHotKeysToJumpToDesktopAltShift.TabStop = true; + this.radioButtonUseHotKeysToJumpToDesktopAltShift.Text = "Alt+Shift+#"; + this.radioButtonUseHotKeysToJumpToDesktopAltShift.UseVisualStyleBackColor = true; + this.radioButtonUseHotKeysToJumpToDesktopAltShift.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopAltShift_CheckedChanged); + // + // radioButtonUseHotKeysToJumpToDesktopCtrlAlt + // + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.AutoSize = true; + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Location = new System.Drawing.Point(112, 5); + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Name = "radioButtonUseHotKeysToJumpToDesktopCtrlAlt"; + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Size = new System.Drawing.Size(71, 17); + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.TabIndex = 7; + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.TabStop = true; + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Text = "Ctrl+Alt+#"; + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.UseVisualStyleBackColor = true; + this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt_CheckedChanged); + // + // radioButtonUseHotKeysToJumpToDesktopCtrl + // + this.radioButtonUseHotKeysToJumpToDesktopCtrl.AutoSize = true; + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Location = new System.Drawing.Point(57, 5); + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Name = "radioButtonUseHotKeysToJumpToDesktopCtrl"; + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Size = new System.Drawing.Size(53, 17); + this.radioButtonUseHotKeysToJumpToDesktopCtrl.TabIndex = 6; + this.radioButtonUseHotKeysToJumpToDesktopCtrl.TabStop = true; + this.radioButtonUseHotKeysToJumpToDesktopCtrl.Text = "Ctrl+#"; + this.radioButtonUseHotKeysToJumpToDesktopCtrl.UseVisualStyleBackColor = true; + this.radioButtonUseHotKeysToJumpToDesktopCtrl.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopCtrl_CheckedChanged); + // + // checkBoxUseHotKeysToJumpToDesktop + // + this.checkBoxUseHotKeysToJumpToDesktop.AutoSize = true; + this.checkBoxUseHotKeysToJumpToDesktop.Location = new System.Drawing.Point(15, 261); + this.checkBoxUseHotKeysToJumpToDesktop.Name = "checkBoxUseHotKeysToJumpToDesktop"; + this.checkBoxUseHotKeysToJumpToDesktop.Size = new System.Drawing.Size(186, 17); + this.checkBoxUseHotKeysToJumpToDesktop.TabIndex = 23; + this.checkBoxUseHotKeysToJumpToDesktop.Text = "Use Hot Keys to Jump to Desktop"; + this.checkBoxUseHotKeysToJumpToDesktop.UseVisualStyleBackColor = true; + this.checkBoxUseHotKeysToJumpToDesktop.CheckedChanged += new System.EventHandler(this.checkBoxUseHotKeysToJumpToDesktop_CheckedChanged); + // // 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(43, 133); this.checkBoxOverlayShowOnAllMonitors.Name = "checkBoxOverlayShowOnAllMonitors"; - this.checkBoxOverlayShowOnAllMonitors.Size = new System.Drawing.Size(219, 29); + this.checkBoxOverlayShowOnAllMonitors.Size = new System.Drawing.Size(124, 17); this.checkBoxOverlayShowOnAllMonitors.TabIndex = 22; this.checkBoxOverlayShowOnAllMonitors.Text = "Show on all Monitors"; this.checkBoxOverlayShowOnAllMonitors.UseVisualStyleBackColor = true; @@ -187,10 +254,9 @@ 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(15, 239); this.checkBoxShowDesktopNameInitial.Name = "checkBoxShowDesktopNameInitial"; - this.checkBoxShowDesktopNameInitial.Size = new System.Drawing.Size(378, 29); + this.checkBoxShowDesktopNameInitial.Size = new System.Drawing.Size(213, 17); this.checkBoxShowDesktopNameInitial.TabIndex = 21; this.checkBoxShowDesktopNameInitial.Text = "Show Desktop Name Initial in Icon Tray"; this.checkBoxShowDesktopNameInitial.UseVisualStyleBackColor = true; @@ -199,10 +265,9 @@ 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(15, 217); this.checkBoxClickDesktopNumberTaskView.Name = "checkBoxClickDesktopNumberTaskView"; - this.checkBoxClickDesktopNumberTaskView.Size = new System.Drawing.Size(521, 29); + this.checkBoxClickDesktopNumberTaskView.Size = new System.Drawing.Size(290, 17); this.checkBoxClickDesktopNumberTaskView.TabIndex = 20; this.checkBoxClickDesktopNumberTaskView.Text = "Clicking Desktop Number in Icon Tray opens Task View"; this.checkBoxClickDesktopNumberTaskView.UseVisualStyleBackColor = true; @@ -214,19 +279,17 @@ 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(40, 62); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(660, 46); + this.panel2.Size = new System.Drawing.Size(360, 25); 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(5, 5); this.radioButtonOverlayMicroDuration.Name = "radioButtonOverlayMicroDuration"; - this.radioButtonOverlayMicroDuration.Size = new System.Drawing.Size(96, 29); + this.radioButtonOverlayMicroDuration.Size = new System.Drawing.Size(56, 17); this.radioButtonOverlayMicroDuration.TabIndex = 9; this.radioButtonOverlayMicroDuration.TabStop = true; this.radioButtonOverlayMicroDuration.Text = "500ms"; @@ -235,10 +298,9 @@ 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(203, 5); this.radioButtonOverlayLongDuration.Name = "radioButtonOverlayLongDuration"; - this.radioButtonOverlayLongDuration.Size = new System.Drawing.Size(107, 29); + this.radioButtonOverlayLongDuration.Size = new System.Drawing.Size(62, 17); this.radioButtonOverlayLongDuration.TabIndex = 8; this.radioButtonOverlayLongDuration.TabStop = true; this.radioButtonOverlayLongDuration.Text = "3000ms"; @@ -247,10 +309,9 @@ 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(137, 5); this.radioButtonOverlayMediumDuration.Name = "radioButtonOverlayMediumDuration"; - this.radioButtonOverlayMediumDuration.Size = new System.Drawing.Size(107, 29); + this.radioButtonOverlayMediumDuration.Size = new System.Drawing.Size(62, 17); this.radioButtonOverlayMediumDuration.TabIndex = 7; this.radioButtonOverlayMediumDuration.TabStop = true; this.radioButtonOverlayMediumDuration.Text = "2000ms"; @@ -259,10 +320,9 @@ 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(69, 5); this.radioButtonOverlayShortDuration.Name = "radioButtonOverlayShortDuration"; - this.radioButtonOverlayShortDuration.Size = new System.Drawing.Size(107, 29); + this.radioButtonOverlayShortDuration.Size = new System.Drawing.Size(62, 17); this.radioButtonOverlayShortDuration.TabIndex = 6; this.radioButtonOverlayShortDuration.TabStop = true; this.radioButtonOverlayShortDuration.Text = "1000ms"; @@ -279,19 +339,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(87, 152); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(114, 109); + this.panel1.Size = new System.Drawing.Size(62, 59); 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(43, 41); this.radioButtonPositionBottomRight.Name = "radioButtonPositionBottomRight"; - this.radioButtonPositionBottomRight.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionBottomRight.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionBottomRight.TabIndex = 26; this.radioButtonPositionBottomRight.TabStop = true; this.radioButtonPositionBottomRight.UseVisualStyleBackColor = true; @@ -299,10 +357,9 @@ 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(23, 41); this.radioButtonPositionBottomCenter.Name = "radioButtonPositionBottomCenter"; - this.radioButtonPositionBottomCenter.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionBottomCenter.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionBottomCenter.TabIndex = 25; this.radioButtonPositionBottomCenter.TabStop = true; this.radioButtonPositionBottomCenter.UseVisualStyleBackColor = true; @@ -310,10 +367,9 @@ 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(3, 41); this.radioButtonPositionBottomLeft.Name = "radioButtonPositionBottomLeft"; - this.radioButtonPositionBottomLeft.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionBottomLeft.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionBottomLeft.TabIndex = 24; this.radioButtonPositionBottomLeft.TabStop = true; this.radioButtonPositionBottomLeft.UseVisualStyleBackColor = true; @@ -321,10 +377,9 @@ 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(43, 22); this.radioButtonPositionMiddleRight.Name = "radioButtonPositionMiddleRight"; - this.radioButtonPositionMiddleRight.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionMiddleRight.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionMiddleRight.TabIndex = 23; this.radioButtonPositionMiddleRight.TabStop = true; this.radioButtonPositionMiddleRight.UseVisualStyleBackColor = true; @@ -332,10 +387,9 @@ 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(23, 22); this.radioButtonPositionMiddleCenter.Name = "radioButtonPositionMiddleCenter"; - this.radioButtonPositionMiddleCenter.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionMiddleCenter.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionMiddleCenter.TabIndex = 22; this.radioButtonPositionMiddleCenter.TabStop = true; this.radioButtonPositionMiddleCenter.UseVisualStyleBackColor = true; @@ -343,10 +397,9 @@ 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(3, 22); this.radioButtonPositionMiddleLeft.Name = "radioButtonPositionMiddleLeft"; - this.radioButtonPositionMiddleLeft.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionMiddleLeft.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionMiddleLeft.TabIndex = 21; this.radioButtonPositionMiddleLeft.TabStop = true; this.radioButtonPositionMiddleLeft.UseVisualStyleBackColor = true; @@ -354,10 +407,9 @@ 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(43, 3); this.radioButtonPositionTopRight.Name = "radioButtonPositionTopRight"; - this.radioButtonPositionTopRight.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionTopRight.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionTopRight.TabIndex = 20; this.radioButtonPositionTopRight.TabStop = true; this.radioButtonPositionTopRight.UseVisualStyleBackColor = true; @@ -365,10 +417,9 @@ 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(23, 3); this.radioButtonPositionTopCenter.Name = "radioButtonPositionTopCenter"; - this.radioButtonPositionTopCenter.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionTopCenter.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionTopCenter.TabIndex = 19; this.radioButtonPositionTopCenter.TabStop = true; this.radioButtonPositionTopCenter.UseVisualStyleBackColor = true; @@ -376,10 +427,9 @@ 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(3, 3); this.radioButtonPositionTopLeft.Name = "radioButtonPositionTopLeft"; - this.radioButtonPositionTopLeft.Size = new System.Drawing.Size(21, 20); + this.radioButtonPositionTopLeft.Size = new System.Drawing.Size(14, 13); this.radioButtonPositionTopLeft.TabIndex = 18; this.radioButtonPositionTopLeft.TabStop = true; this.radioButtonPositionTopLeft.UseVisualStyleBackColor = true; @@ -387,20 +437,18 @@ 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(40, 153); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(87, 25); + this.label1.Size = new System.Drawing.Size(47, 13); 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(43, 111); this.checkBoxOverlayTranslucent.Name = "checkBoxOverlayTranslucent"; - this.checkBoxOverlayTranslucent.Size = new System.Drawing.Size(141, 29); + this.checkBoxOverlayTranslucent.Size = new System.Drawing.Size(82, 17); this.checkBoxOverlayTranslucent.TabIndex = 7; this.checkBoxOverlayTranslucent.Text = "Translucent"; this.checkBoxOverlayTranslucent.UseVisualStyleBackColor = true; @@ -408,10 +456,9 @@ 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(43, 88); this.checkBoxOverlayAnimate.Name = "checkBoxOverlayAnimate"; - this.checkBoxOverlayAnimate.Size = new System.Drawing.Size(169, 29); + this.checkBoxOverlayAnimate.Size = new System.Drawing.Size(98, 17); this.checkBoxOverlayAnimate.TabIndex = 6; this.checkBoxOverlayAnimate.Text = "Animate In/Out"; this.checkBoxOverlayAnimate.UseVisualStyleBackColor = true; @@ -419,10 +466,9 @@ 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(15, 42); this.checkBoxShowOverlay.Name = "checkBoxShowOverlay"; - this.checkBoxShowOverlay.Size = new System.Drawing.Size(375, 29); + this.checkBoxShowOverlay.Size = new System.Drawing.Size(211, 17); this.checkBoxShowOverlay.TabIndex = 2; this.checkBoxShowOverlay.Text = "Show Overlay when switching Desktop"; this.checkBoxShowOverlay.UseVisualStyleBackColor = true; @@ -431,11 +477,9 @@ 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(12, 326); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Padding = new System.Windows.Forms.Padding(6); - this.groupBox2.Size = new System.Drawing.Size(757, 89); + this.groupBox2.Size = new System.Drawing.Size(413, 48); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "Settings"; @@ -443,10 +487,9 @@ 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(15, 19); this.checkBoxStartupWithWindows.Name = "checkBoxStartupWithWindows"; - this.checkBoxStartupWithWindows.Size = new System.Drawing.Size(226, 29); + this.checkBoxStartupWithWindows.Size = new System.Drawing.Size(129, 17); this.checkBoxStartupWithWindows.TabIndex = 1; this.checkBoxStartupWithWindows.Text = "Startup with Windows"; this.checkBoxStartupWithWindows.UseVisualStyleBackColor = true; @@ -460,91 +503,26 @@ private void InitializeComponent() { this.notifyIconName.Visible = true; this.notifyIconName.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIconName_MouseClick); // - // 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.Name = "checkBoxUseHotKeysToJumpToDesktop"; - this.checkBoxUseHotKeysToJumpToDesktop.Size = new System.Drawing.Size(331, 29); - this.checkBoxUseHotKeysToJumpToDesktop.TabIndex = 23; - this.checkBoxUseHotKeysToJumpToDesktop.Text = "Use Hot Keys to Jump to Desktop"; - this.checkBoxUseHotKeysToJumpToDesktop.UseVisualStyleBackColor = true; - this.checkBoxUseHotKeysToJumpToDesktop.CheckedChanged += new System.EventHandler(this.checkBoxUseHotKeysToJumpToDesktop_CheckedChanged); - // - // panel3 - // - this.panel3.Controls.Add(this.radioButtonUseHotKeysToJumpToDesktopAlt); - 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.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(660, 46); - 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.Name = "radioButtonUseHotKeysToJumpToDesktopAlt"; - this.radioButtonUseHotKeysToJumpToDesktopAlt.Size = new System.Drawing.Size(83, 29); - this.radioButtonUseHotKeysToJumpToDesktopAlt.TabIndex = 9; - this.radioButtonUseHotKeysToJumpToDesktopAlt.TabStop = true; - this.radioButtonUseHotKeysToJumpToDesktopAlt.Text = "Alt+#"; - this.radioButtonUseHotKeysToJumpToDesktopAlt.UseVisualStyleBackColor = true; - this.radioButtonUseHotKeysToJumpToDesktopAlt.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopAlt_CheckedChanged); - // - // radioButtonUseHotKeysToJumpToDesktopAltShift + // checkBoxUseHotKeyToJumpToMostRecentDesktop // - this.radioButtonUseHotKeysToJumpToDesktopAltShift.AutoSize = true; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Location = new System.Drawing.Point(343, 9); - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Margin = new System.Windows.Forms.Padding(6); - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Name = "radioButtonUseHotKeysToJumpToDesktopAltShift"; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Size = new System.Drawing.Size(134, 29); - this.radioButtonUseHotKeysToJumpToDesktopAltShift.TabIndex = 8; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.TabStop = true; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.Text = "Alt+Shift+#"; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.UseVisualStyleBackColor = true; - this.radioButtonUseHotKeysToJumpToDesktopAltShift.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopAltShift_CheckedChanged); - // - // 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.Name = "radioButtonUseHotKeysToJumpToDesktopCtrlAlt"; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Size = new System.Drawing.Size(125, 29); - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.TabIndex = 7; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.TabStop = true; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Text = "Ctrl+Alt+#"; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.UseVisualStyleBackColor = true; - this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopCtrlAlt_CheckedChanged); - // - // 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.Name = "radioButtonUseHotKeysToJumpToDesktopCtrl"; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.Size = new System.Drawing.Size(90, 29); - this.radioButtonUseHotKeysToJumpToDesktopCtrl.TabIndex = 6; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.TabStop = true; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.Text = "Ctrl+#"; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.UseVisualStyleBackColor = true; - this.radioButtonUseHotKeysToJumpToDesktopCtrl.CheckedChanged += new System.EventHandler(this.radioButtonUseHotKeysToJumpToDesktopCtrl_CheckedChanged); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.AutoSize = true; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Location = new System.Drawing.Point(27, 316); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Name = "checkBoxUseHotKeyToJumpToMostRecentDesktop"; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Size = new System.Drawing.Size(309, 17); + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.TabIndex = 24; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.Text = "Use Hot Key (Modifier + 0) to Jump to Most Recent Desktop"; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.UseVisualStyleBackColor = true; + this.checkBoxUseHotKeyToJumpToMostRecentDesktop.CheckedChanged += new System.EventHandler(this.checkBoxUseHotKeyToJumpToMostRecentDesktop_CheckedChanged); // // SettingsForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(805, 713); + this.ClientSize = new System.Drawing.Size(439, 380); + this.Controls.Add(this.checkBoxUseHotKeyToJumpToMostRecentDesktop); 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.MaximizeBox = false; this.MinimizeBox = false; this.Name = "SettingsForm"; @@ -556,15 +534,16 @@ private void InitializeComponent() { this.contextMenuStrip1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); - this.panel3.ResumeLayout(false); - this.panel3.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -611,5 +590,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..c16131b 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; @@ -341,5 +344,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 = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopAltShift.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopCtrl.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; + + if (!IsLoading) App.Instance.SetupHotKeys(); + } } } From f5ea23b8d6fe6a2d41df5845ad3dcf7f12a2ba70 Mon Sep 17 00:00:00 2001 From: Saif Masoud Date: Thu, 25 Jan 2024 13:38:54 -0500 Subject: [PATCH 2/3] Fix: Keep hotkey radio buttons enabled when either hotkey feature is checked --- Source/Forms/SettingsForm.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Forms/SettingsForm.cs b/Source/Forms/SettingsForm.cs index c16131b..1c26850 100644 --- a/Source/Forms/SettingsForm.cs +++ b/Source/Forms/SettingsForm.cs @@ -321,10 +321,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(); } @@ -346,10 +346,10 @@ private void radioButtonUseHotKeysToJumpToDesktopAltShift_CheckedChanged(object } private void checkBoxUseHotKeyToJumpToMostRecentDesktop_CheckedChanged(object sender, EventArgs e) { - radioButtonUseHotKeysToJumpToDesktopAlt.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; - radioButtonUseHotKeysToJumpToDesktopAltShift.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; - radioButtonUseHotKeysToJumpToDesktopCtrl.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.Checked; - radioButtonUseHotKeysToJumpToDesktopCtrlAlt.Enabled = checkBoxUseHotKeyToJumpToMostRecentDesktop.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(); } From da74f4015072c6ae6c963b65d2f5da644900d913 Mon Sep 17 00:00:00 2001 From: Saif Masoud Date: Thu, 25 Jan 2024 17:04:27 -0500 Subject: [PATCH 3/3] Save hotkey setting for most recent desktop --- Source/Forms/SettingsForm.cs | 3 +++ Source/Properties/Settings.Designer.cs | 24 ++++++++++++++++++++++++ Source/Properties/Settings.settings | 3 +++ Source/app.config | 3 +++ 4 files changed, 33 insertions(+) diff --git a/Source/Forms/SettingsForm.cs b/Source/Forms/SettingsForm.cs index 1c26850..b319a0c 100644 --- a/Source/Forms/SettingsForm.cs +++ b/Source/Forms/SettingsForm.cs @@ -115,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"; @@ -134,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; @@ -145,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"; 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 +