-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hot corners functionality to PowerToys #1305
Comments
One thing to note: the Windows 10 interface already includes actions for three of the four screen corners. Clockwise from top right, we have Close Window, Show/Peek At Desktop, and the Start Menu. In addition, for apps with their icon in the upper left corner (and Chrome, before receiving Material Design tabs), clicking there gives options like Restore, Move, Minimize, and Maximize. To summarize: your idea is appealing, but it seems that (most of) the screen corners are already full. |
@LRitzdorf thanks. But I meant the actions that are done when you get to the corner with your mouse, without click. This could speed up work in certain situations. For example, after reaching the upper left corner, a view of tasks would show up. |
Task View from the upper left corner would definitely be useful, but what happens when you try to close a window from the upper right corner and accidentally trigger the associated hot corner action? Just trying to avoid counterproductive results here. |
@LRitzdorf Some tools of this type allow you to set a slight delay (500ms for example) to prevent this behavior. Others trigger the action only when "pressure" on a corner is detected (similar to showing a hidden dock in macOS). |
@widersky Excellent point, both of those would certainly help. |
neat idea. |
adding help wanted sticker as it isn't something that we're planning for v1.0. If a community member would love to work with us, happy to spend time with everyone help out with design. |
I use an AutoHotKey script to do this exact thing—touching the mouse to the upper left-hand corner of my screen triggers the Task View. It's immensely useful to me, and a habit I picked up from macOS where I do the same gesture to trigger its Task View equivalent, "Mission Control". I think it's a perfect fit for PowerToys! For what it's worth, it was previously suggested under #1003 in December, so I know there's been some interest in it for awhile. Edit: Here's a gist of my AHK hotcorners script. I've tried to document it well so you can customize it to suit your needs, but feel free to comment on the gist with any questions! |
Love this idea and sorely miss this feature from macOS. Would love to see this come to Windows as a PowerToy. |
Would love to see this idea implemented as well. |
This totally would make life easier whenever 1 use my windows PC |
It would be so useful to have one of the corners prevent sleep/screen saver by default since that feature doesn't seem to exist in windows by default and even 3rd party is clunky at best. It might need to use the same sleep prevention mechanism that media playback apps use, but I'm not sure how that might affect notifications. In any case, sleep prevention is so desperately needed for those who utilize external devices, like microscopes and watching on the screen. The damn computer eternally attempts to sleep because there's no need to touch the keyboard or mouse for extended periods and turning off sleep isn't a very power conservation way to go either. |
Would love to see this! This is one clear usability perk that macOS has over Windows today that I would love to see Windows gain. Seems like a good fit for Power Toys. |
@widersky You mean like Windows 8 had? |
@Jay-o-Way I don't know how it was in Windows 8, I almost don't use this version of Windows. |
If anyone wants a temporal workaround, you can use AutoHotkey as I explain in the following post: |
I just want to mention the tool There's a similar feature as shown here. You can set a command in the stay(beta) to open an app. |
Why are current the screen corners fixed? This feel narrow minded. What if the windows user do not use this current corners feature because they wish for other actions to increase their productivity? |
Just to add some perspective from the point of view of a long time Linux user here... We have had this feature for many years in many different desktop environments, but as a KDE Plasma user myself, I find that one to be the most well polished implementation. For starters, we can choose which action we want to trigger by touching with the mouse pointer on any corner as well as on any edge, like in this capture below: As you can see there, clicking on each white dot lets me choose what I want to do on that edge or corner, or not doing anything at all. On the top right corner I have enabled "Present Windows", which is similar to the Task Switcher in Windows: In particular, this is the productivity hack I miss the most when I have to work on a Windows operating system. The sheer convenience of touching on the corner and switching immediately to another window is amazing. Another useful one is when I touch on the lower right corner, which displays all the virtual desktops laid out as a Desktop Grid. Bonus points because each display (laptop screen and External Display) shows the virtual desktops with the windows that are open on that screen instead of along both screens. The image below shows both displays side by side: I hope this helps a bit to bring these features to Windows as well :-) ** fingers crossed ** Cheers! |
From what I can see, it seems that this feature is not a priority for you, despite the significant number of requests from users and the constant duplication of the topic. Perhaps this project will help you kick-start the implementation of this feature. It is written in C#, which makes it suitable for this project, unlike many others. The only thing missing in its implementation is that the hot corner remains active even in fullscreen applications, leading to false positives. As for everything else, in my opinion, it is well suited as a foundation for implementing this excellent feature. https://github.com/LucaReggiannini/winycorners And as for the implementation principle of hot corners as a whole, you can take this excellent project as a basis: |
I opened PowerToys assuming this feature was included but not yet I guess! Seems a natural fit. Still miss hot corners from growing up on Macs. |
After using hot corners on Gnome 4x to scatter my desktop and pick the window I want to focus on, I am craving this feature on Windows. It's so great for productivity. All it essentialy is is detecting the mouse hitting the top left of the screen and opening the "Task View" (same as super+d keyboard shortcut). |
I had opened a similar request in 2020 and its end of 2023 and still finding this feature missing from is kind of a sad. Not sure what stopping the development of this feature. :( |
It's too bad this is not implemented yet, as the feature is immensely useful. It's something that has nearly completely replaced alt+tabbing for me on my gnome environment. |
GitHub's search results for "hot corner windows" still returns a number of highly-starred projects in a variety of languages, including:
I suppose the difficulty comes from time spent integrating with the existing C#/C++ codebase for any of these project maintainers/contributors. |
Author of https://github.com/timrobertsdev/hotcorners (the Rust implementation) here, I'm more than willing to put in the research and work required to polish up my own project and how it could integrate/package with PowerToys, if there's sufficient interest. A C++ port isn't out of the question either, I just prefer Rust for what was intended to be a personal project :) It was actually inspired by the same functionality present in GNOME and was the only thing I missed when I came back to Windows. |
I'm used to the top-left mouse fling for GNOME overview on Linux, and would love this on Windows! I'll look at the projects mentioned, but I would prefer this to be as-native or official as possible; I have history with explorer/shell modifiers not being ideal or getting outdated/broken with Windows updates. Edit: Went with https://github.com/timrobertsdev/hotcorners as it looked the most minimal and it works great! |
And wouldn't you know it, the author of that repo (@timrobertsdev) is the immediate comment before yours! |
Fat +1 on this feature. |
Another fat +1 from me! |
Really would be an incredible add. That is one of the best features a OS should have since long time. Thanks for everybody working on this! |
So many people keep implying this is a macOS invention, when it existed in Windows 95 via Microsoft Plus! back in 1994. It completely predates macOS, OS X, Mac OS X, and Mac OS. This was System 7 days! Some (most?) people here probably didn't even exist when Microsoft themselves invented it. ;-) To be fair it did not predate NeXTSTEP. I'll give you that. And although it doesn't quite predate Linux, it certainly predates popular Linux desktop environments like GNOME, Xfce, KDE, etc. (but not X Window System). More importantly, I found a 150 liner workaround for those who don't fear the lost art of asking a CPU to perform a simple task without the ridiculous overhead of modern engineering nightmares: Tiny Hot Corners |
They might have invented it, but still never used or incorporated it in a serious way to allow people to perform certain tasks or to make the UI more usable (: I know about Tiny Hot Corners, but still I'd prefer some smart implementation from PowerToys since it's a killer functionality. Thanks for your explanation |
Would love to have this feature built in powertoys |
Made a minimal proof of concept in C++, used AI for some cleanup/optimisation tips. TLDR; Happy for any and all feedback! Compile using MinGW or MSVC, if you need any help with this let me know. Current corner functions: The current logic to prevent it getting stuck triggering shortcuts is waiting for the cursor to move at least 8px from the corner. Previously I was just using a 500ms timeout but this makes more sense. Using my taskbar at the top of my screen, I also haven't had an issue with hot corners interfering with the window close button. The corners also have a 5px zone for triggering. I haven't tested this with multiple monitors (I use a single ultrawide) so I am not sure of the effects. Will also have to consider this for the real implementation. I'm guessing there are libraries in C# to help with this and maybe also code in Powertoys Run for monitor selection. #include <windows.h>
#include <iostream>
#include <map>
#include <cmath>
using namespace std;
// Get screen dimensions. Not sure how to handle multiple monitors yet.
int SCREEN_WIDTH = GetSystemMetrics(SM_CXSCREEN);
int SCREEN_HEIGHT = GetSystemMetrics(SM_CYSCREEN);
const int CORNER_THRESHOLD = 5;
const int DEBOUNCE_DISTANCE = 8; // Minimum pixels moved to reset trigger
// Track last triggered position & corner
POINT lastTriggerPos = {-100, -100};
string lastCorner = "";
double distance(const POINT& p1, const POINT& p2) {
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
}
void simulateKeypress(WORD key1, WORD key2) {
INPUT inputs[4] = {};
// Press keys
inputs[0].type = inputs[1].type = INPUT_KEYBOARD;
inputs[0].ki.wVk = key1;
inputs[1].ki.wVk = key2;
// Release keys
inputs[2] = inputs[0];
inputs[3] = inputs[1];
inputs[2].ki.dwFlags = KEYEVENTF_KEYUP;
inputs[3].ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(4, inputs, sizeof(INPUT));
}
void triggerAction(const string& corner, POINT currentPos) {
// Prevent retriggering if already activated in this corner
if (corner == lastCorner) return;
cout << "Triggered: " << corner << endl;
lastCorner = corner;
lastTriggerPos = currentPos;
if (corner == "top_left") {
simulateKeypress(VK_MENU, VK_SPACE); // Alt + Space (PowerToys Run)
} else if (corner == "top_right") {
simulateKeypress(VK_LWIN, 'A'); // Open Action Center
} else if (corner == "bottom_left") {
ShellExecuteW(NULL, L"open", L"calc.exe", NULL, NULL, SW_SHOWNORMAL); // Open Calculator
} else if (corner == "bottom_right") {
simulateKeypress(VK_LWIN, 'E'); // Win + E (Explorer)
}
}
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) {
if (nCode >= 0 && wParam == WM_MOUSEMOVE) {
MSLLHOOKSTRUCT* mouse = (MSLLHOOKSTRUCT*)lParam;
int x = mouse->pt.x, y = mouse->pt.y;
string currentCorner = "";
if (x < CORNER_THRESHOLD && y < CORNER_THRESHOLD) currentCorner = "top_left";
else if (x > SCREEN_WIDTH - CORNER_THRESHOLD && y < CORNER_THRESHOLD) currentCorner = "top_right";
else if (x < CORNER_THRESHOLD && y > SCREEN_HEIGHT - CORNER_THRESHOLD) currentCorner = "bottom_left";
else if (x > SCREEN_WIDTH - CORNER_THRESHOLD && y > SCREEN_HEIGHT - CORNER_THRESHOLD) currentCorner = "bottom_right";
if (!currentCorner.empty()) {
triggerAction(currentCorner, mouse->pt);
} else {
lastCorner = "";
}
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
int main() {
cout << "Corner Hotkey Trigger Running... Move your cursor to screen corners to activate.\n";
HHOOK mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, NULL, 0);
if (!mouseHook) {
cerr << "Failed to install mouse hook.\n";
return 1;
}
// Non-blocking event loop to prevent input interference
MSG msg;
while (true) {
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Sleep(10); // Avoid high CPU usage
}
UnhookWindowsHookEx(mouseHook);
return 0;
} |
Modified to switch desktops @D-Arora. It's smooth.
|
Summary of the new feature/enhancement
Operating systems such as macOS or some Linux distributions have hot corners option in their functionality. It would be great to have something like that in Windows. Although there are third party applications that provide such functionality (e.g. WinX Corners), they are sometimes limited.
Proposed technical implementation details (optional)
For example, you can set one of the default options:
The text was updated successfully, but these errors were encountered: