Skip to content
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 hotkeys to tray menu #3

Open
ghokun opened this issue Dec 30, 2021 · 4 comments
Open

Add hotkeys to tray menu #3

ghokun opened this issue Dec 30, 2021 · 4 comments

Comments

@ghokun
Copy link
Contributor

ghokun commented Dec 30, 2021

Rectangle provides hot keys as tray menu items:

rectangle

Initial work is here (buttons not working currently, needs work):
https://github.com/ghokun/RectangleWin/commit/61b2cbe46d1118860b5f4e87360e7942e82ac622

buttons

Problems:

  • We need to keep track of active window (or latest active window that can be resizable)
  • I tried to get process id of current window and compare it with RectangleWin process id. Looks like tray menu returns different process id.

Instead of a endless loop, active window changed hook could be used:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwineventhook?redirectedfrom=MSDN
https://stackoverflow.com/questions/4407631/is-there-windows-system-event-on-active-window-changed

@ahmetb
Copy link
Owner

ahmetb commented Dec 30, 2021

That seems a bit excessive. I'd focus on creating a way for configuring the shortcuts.

@ahmetb
Copy link
Owner

ahmetb commented Dec 30, 2021

To be clear, I think clicking on system tray to snap windows is out of scope for this tool as this tool intends to be hotkey-driven.

@ghokun
Copy link
Contributor Author

ghokun commented Dec 30, 2021

Fair enough. I am a long time user of rectangle on macos and I always forget some of the bindings (mostly cmd shift and ctrl) because of context switching between multiple OSes during the day. I click the tray icon to quickly remember what it was. Maybe we could add them as readonly items with their current bindings.

@ahmetb
Copy link
Owner

ahmetb commented Dec 30, 2021

I think a UI like the Rectangle's screenshot in its readme where people can go to modify the hotkeys is the most preferable as it's for both learning and modifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants