-
Notifications
You must be signed in to change notification settings - Fork 282
Add Win+[0-9] hotkeys to quickly switch between windows #1128
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
base: master
Are you sure you want to change the base?
Conversation
Btw I tried using the regular RegisterHotKey function from user32.dll but the Win+[0-9] hotkeys seem to be reserved by the system and the app fails to register them |
I think this is possible, we can just kill the |
I found another way to allow us to use |
I suspect #783 (comment) is a similar case, maybe calling |
Wow tysm for finding this! Just tried it out and can confirm the hotkeys are able to be registered after first disabling them in the registry. Also for some reason reading the hotkeys this way magically fixed the first issue.... windows works in mysterious ways |
Just would like to request that this be an option instead of a default, because it would break Start menu functionality that Open-Shell replicates. In that I have always configured the Windows 95-2000 style Start menu with pinned apps that have names starting with 0-9, so I can do Win+number to instantly open new programs from the keyboard. I assume it would be optional already, but figured I'd chime in. Not a bad option to have though. |
@vindasal Yeah the current implementation adds an option for it in the advanced menu, it's almost ready just gotta fix some stuff |
Big news yall, I found an undocumented(?) window message in Shell_TrayWnd that lets you unregister hotkeys without restarting explorer, here's an example in C: HWND hTrayWnd = FindWindow(
/*lpClassName:*/ "Shell_TrayWnd",
/*lpWindowName:*/ ""
);
SendMessage(
/*hWnd:*/ hTrayWnd,
/*uMsg:*/ WM_USER + 231, // 0x4e7
/*wParam:*/ hotkeyIdToUnregister, // current explorer uses 0x205-0x20e for taskbar hotkeys
/*lParam:*/ 0
); I implemented this in my most recent commit, so now explorer restarts are no longer required!* |
I've just tested this new method and can confirm that it works like a charm on Windows 8.1 and Windows 11 (with StartAllBack enabled or not), but I haven't been able to check its compatibility with other closed-source taskbar replacements, like the ExplorerPatcher taskbar or Start11. Unfortunately, it doesn't seem to disable the hotkeys on Windows 7 (yes, RetroBar supports this OS). Maybe you really need to restart Explorer there? |
@noxrim, check this! It seems that it has a different mapping (for Vista at least?): https://sourceforge.net/p/virtuawin/discussion/257054/thread/cbd60dd2/ |
Wow I can't believe this even runs on Windows 7
Did some testing on multiple versions of Windows, it appears that the hotkey IDs in explorer have shifted over the years, so RetroBar will have to account for this to unregister them properly:
The taskbar hotkeys are stored sequentially in explorer.exe and registered in order starting from 500 (0x1f4), so I'll try and write an algorithm to find the hotkey table and determine the ID range for the current version of Windows. |
That's interesting, on Windows 8.1 and Windows 10 21H2 LTSC the first hotkey ID for this starts at 0x205, Windows 8 at 0x204 and Windows 7 at 0x202, not sure if the updates have made some shift in the values for the same base Windows release/product version. Also on Vista, the same Win+number hotkeys open the Quick Launch toolbar shortcuts instead of the taskbar items. It may be useful to have them as an option to switch to open them as well. You could use |
Alright it works on win7 now, I'll add an option to launch items from Quick Launch and then I'll mark this as ready for review since I'm kinda done with it |
Hi y'all, I've been using RetroBar for a little bit now and I love it, but I noticed it's missing a feature from the regular taskbar where you can press the Windows key + any number to quickly switch between windows in the taskbar. I use this feature a lot so I went ahead and tried implementing it myself.
Currently this is a draft because it has some issues:
All the issues above have been fixed, thx @xoascf!