Skip to content

Commit 1e06ae3

Browse files
Copilotshanselman
andcommitted
Remove global hotkey for toggle controls, keep only tray menu functionality
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
1 parent 29a3f61 commit 1e06ae3

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ A lightweight WPF application that adds a customizable glowing edge light effect
1212
- **Customizable Brightness**: Adjust opacity with easy-to-use controls
1313
- **Adjustable Color Temperature**: Shift the edge light from cooler (blue-ish) to warmer (amber) tones
1414
- **Toggle On/Off**: Quickly enable or disable the edge light effect
15-
- **Hideable Controls**: Hide the control toolbar for a cleaner look, restore via hotkey or tray menu
15+
- **Hideable Controls**: Hide the control toolbar for a cleaner look, restore via tray menu
1616
- **Always On Top**: Stays visible above all other windows
1717
- **Keyboard Shortcuts**:
1818
- `Ctrl+Shift+L` - Toggle light on/off
1919
- `Ctrl+Shift+Up` - Increase brightness
2020
- `Ctrl+Shift+Down` - Decrease brightness
21-
- `Ctrl+Shift+C` - Show/hide controls toolbar
2221
- **Gradient Effect**: Beautiful white gradient with subtle blur for a professional look
2322

2423
## Screenshots
@@ -87,14 +86,13 @@ The executable will be in `bin\Release\net10.0-windows\win-x64\publish\WindowsEd
8786
- 💡 **Toggle Light** - Turn the effect on/off
8887
- 🖥️ **Switch Monitor** - Move to next monitor (if multiple monitors)
8988
-**Exit** - Close the application
90-
4. Hide the control toolbar for a cleaner look using `Ctrl+Shift+C` or the tray menu
89+
4. Hide the control toolbar for a cleaner look using the tray menu (right-click tray icon → "Hide Controls")
9190

9291
### Keyboard Shortcuts
9392

9493
- **Ctrl+Shift+L**: Toggle the edge light on/off
9594
- **Ctrl+Shift+Up**: Increase brightness
9695
- **Ctrl+Shift+Down**: Decrease brightness
97-
- **Ctrl+Shift+C**: Show/hide the control toolbar
9896
- **Taskbar**: Right-click the taskbar icon for a menu with toggle, brightness, and color temperature controls
9997

10098
## Technical Details

WindowsEdgeLight/MainWindow.xaml.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public partial class MainWindow : Window
2525
private const double MinColorTemp = 0.0;
2626
private const double MaxColorTemp = 1.0;
2727

28-
// Toggle controls constants
29-
private const string ToggleControlsHotkeyText = " (Ctrl+Shift+C)";
30-
3128
private NotifyIcon? notifyIcon;
3229
private ControlWindow? controlWindow;
3330
// Tracks whether the control window should be visible (controls initial visibility and toggle state)
@@ -44,7 +41,6 @@ public partial class MainWindow : Window
4441
private const int HOTKEY_TOGGLE = 1;
4542
private const int HOTKEY_BRIGHTNESS_UP = 2;
4643
private const int HOTKEY_BRIGHTNESS_DOWN = 3;
47-
private const int HOTKEY_TOGGLE_CONTROLS = 4;
4844

4945
[DllImport("user32.dll")]
5046
private static extern int GetSystemMetrics(int nIndex);
@@ -110,7 +106,6 @@ private struct POINT
110106
private const uint VK_L = 0x4C;
111107
private const uint VK_UP = 0x26;
112108
private const uint VK_DOWN = 0x28;
113-
private const uint VK_C = 0x43;
114109

115110
public MainWindow()
116111
{
@@ -162,7 +157,7 @@ private void SetupNotifyIcon()
162157
contextMenu.Items.Add(new ToolStripSeparator());
163158

164159
// Add toggle controls menu item - text will be set by UpdateTrayMenuToggleControlsText
165-
toggleControlsMenuItem = new ToolStripMenuItem("🎛️ Hide Controls" + ToggleControlsHotkeyText, null, (s, e) => ToggleControlsVisibility());
160+
toggleControlsMenuItem = new ToolStripMenuItem("🎛️ Hide Controls", null, (s, e) => ToggleControlsVisibility());
166161
contextMenu.Items.Add(toggleControlsMenuItem);
167162

168163
contextMenu.Items.Add(new ToolStripSeparator());
@@ -185,7 +180,6 @@ private void ShowHelp()
185180
💡 Toggle Light: Ctrl + Shift + L
186181
🔆 Brightness Up: Ctrl + Shift + ↑
187182
🔅 Brightness Down: Ctrl + Shift + ↓
188-
🎛️ Toggle Controls: Ctrl + Shift + C
189183
190184
💡 Features:
191185
• Click-through overlay - won't interfere with your work
@@ -264,7 +258,6 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
264258
RegisterHotKey(hwnd, HOTKEY_TOGGLE, MOD_CONTROL | MOD_SHIFT, VK_L);
265259
RegisterHotKey(hwnd, HOTKEY_BRIGHTNESS_UP, MOD_CONTROL | MOD_SHIFT, VK_UP);
266260
RegisterHotKey(hwnd, HOTKEY_BRIGHTNESS_DOWN, MOD_CONTROL | MOD_SHIFT, VK_DOWN);
267-
RegisterHotKey(hwnd, HOTKEY_TOGGLE_CONTROLS, MOD_CONTROL | MOD_SHIFT, VK_C);
268261

269262
// Hook into Windows message processing
270263
HwndSource source = HwndSource.FromHwnd(hwnd);
@@ -462,10 +455,6 @@ private IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref
462455
DecreaseBrightness();
463456
handled = true;
464457
break;
465-
case HOTKEY_TOGGLE_CONTROLS:
466-
ToggleControlsVisibility();
467-
handled = true;
468-
break;
469458
}
470459
}
471460

@@ -480,7 +469,6 @@ protected override void OnClosed(EventArgs e)
480469
UnregisterHotKey(hwnd, HOTKEY_TOGGLE);
481470
UnregisterHotKey(hwnd, HOTKEY_BRIGHTNESS_UP);
482471
UnregisterHotKey(hwnd, HOTKEY_BRIGHTNESS_DOWN);
483-
UnregisterHotKey(hwnd, HOTKEY_TOGGLE_CONTROLS);
484472

485473
if (notifyIcon != null)
486474
{
@@ -569,8 +557,7 @@ private void UpdateTrayMenuToggleControlsText()
569557
{
570558
if (toggleControlsMenuItem != null)
571559
{
572-
var prefix = isControlWindowVisible ? "🎛️ Hide Controls" : "🎛️ Show Controls";
573-
toggleControlsMenuItem.Text = prefix + ToggleControlsHotkeyText;
560+
toggleControlsMenuItem.Text = isControlWindowVisible ? "🎛️ Hide Controls" : "🎛️ Show Controls";
574561
}
575562
}
576563

0 commit comments

Comments
 (0)