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

[FancyZones] Win+Ctrl+Arrow to switch focus to adjacent zones #2303

Open
0b01 opened this issue Apr 21, 2020 · 17 comments
Open

[FancyZones] Win+Ctrl+Arrow to switch focus to adjacent zones #2303

0b01 opened this issue Apr 21, 2020 · 17 comments
Labels
FancyZones-Dragging&UI FancyZone dragging / interaction issue Idea-Enhancement New feature or request on an existing product Product-FancyZones Refers to the FancyZones PowerToy

Comments

@0b01
Copy link

0b01 commented Apr 21, 2020

Summary of the new feature/enhancement

In i3, user can switch focus to adjacent zones in 4 directions using hotkeys (Mod1 + jkl;).

Proposed technical implementation details (optional)

FancyZones can include shortcuts Win + Ctrl + LEFT/RIGHT leveraging MoveWindowIntoZoneByDirection implementation. The choice of the hotkey is based on Window Walker WIN + CTRL.

@0b01 0b01 changed the title Using Win+Ctrl+Arrow to switch focus to adjacent zones [FancyZones] Using Win+Ctrl+Arrow to switch focus to adjacent zones Apr 21, 2020
@enricogior enricogior added FancyZones-Dragging&UI FancyZone dragging / interaction issue Idea-Enhancement New feature or request on an existing product labels Apr 22, 2020
@enricogior
Copy link
Contributor

Hi @0b01
thank you for your feedback, it would be a nice feature to have but unfortunately the WIN+CTRL+Arrow is reserved to switch virtual desktops.
Given it's hard to find available shortcut keys, we can implement only those who receives the community approval. An alternative would be to add an option to let the users choose their own shortcuts, but it's not in the short terms plan for now.
Thanks.

@enricogior
Copy link
Contributor

enricogior commented Apr 22, 2020

When I posted my previous comment I didn't noticed you already implemented it.
We need to discuss if the default shortcut key is acceptable since it will cause a conflict with virtual desktops.

@crutkas what is your take on this?

EDIT: in the PR the actual shotcut key is not WIN+CTRL+Arrow as stated in the issue, but WIN+CTRL+ALT+Arrow.

@crutkas
Copy link
Member

crutkas commented Apr 23, 2020

I think there are a lot of decisions here that should be discussed

  • canvas vs grid.
  • all the edge cases for navigation ...

@YAMLcase
Copy link

Am I to understand this is an alternative to Alt+Tab? Where rather than cycling through an arbitrary list of all applications open on a desktop to change focus, we can directionally choose which app gets focus?

@kaisellgren
Copy link

As someone who writes a lot (articles, programming, etc.) I find this a super handy feature in PopOS where they have implemented this in pop-os/shell.

Am I to understand this is an alternative to Alt+Tab? Where rather than cycling through an arbitrary list of all applications open on a desktop to change focus, we can directionally choose which app gets focus?

Yes! When you have windows stacked, Alt+Tab works fine, but when you have windows tiled horizontally/vertically/both, then being able to move your focus from one window to another visually is extremely handy. I'm so used to this in PopOS and i3.

Let the user define the shortcut key. By default it could be empty (no way to trigger it = no conflicts).

As for edge cases, I think the most important thing is to move the focus to a window that is top-most along with a threshold. Consider this:

image

If I now press <unknown> + Right Arrow, it should move focus to the top-most "B" notepad window, not the bottom one. However, there should be a threshold, if the "A" notepad window is peeking out far more than a T pixels (threshold T), then it should move to it. A good default threshold is around 32px. Otherwise without this, it's too easy to accidentally move the focus to a window underneath (just because it happened to peek out by few pixels and the windows weren't 100% stacked properly).

@enricogior enricogior changed the title [FancyZones] Using Win+Ctrl+Arrow to switch focus to adjacent zones [FancyZones] Win+Ctrl+Arrow to switch focus to adjacent zones Jan 1, 2021
@polak-jan
Copy link

I am sorry for commenting after it was close, but I am not sure I understand that tracking issue well. It only looks like a list of ideas, not a place to vote for them or something, and since this is closed it doesn't seem to be the place either.
I would really like to see this feature, but I have no idea where to find out whether it is being considered or an estimate for when it could be worked on. Could you please direct me to somewhere I could find that information?

@enricogior
Copy link
Contributor

enricogior commented Jan 3, 2021

@polak-jan
you can up vote the issue if if it's close.
There are a lot of ideas, and people tend to open a lot of duplicates, tracking all has become unmanageable unless we keep them in one place where it's easier to find duplicates.

Over 270 duplicates just for FZ https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+label%3AProduct-FancyZones+label%3AResolution-Duplicate+is%3Aclosed+-label%3AIssue-Bug+
If we keep all the ideas open, to find duplicates becomes a full time job, instead of working on fixing bugs and add features to the product

@technoyes
Copy link

I know this issue is closed, but since it is linked from the "tracking issue" I will try to add this comment here since I can't think of a better place.

I understand that the number of available keyboard shortcuts is limited. One idea for this particular feature that that would not consume yet another keyboard combination is to add a configuration option that allows you to decide if WIN + Arrow moves the current window to an adjacent zone, or if it just moves the focus. I personally very seldom move windows around. I start up all my apps, put them in zones, then I'm mostly just moving around among them while working. This is where moving focus using the keyboard in an intuitive manner would allow working almost exclusively with the keyboard for many tasks.

@enricogior enricogior reopened this Apr 19, 2021
@YAMLcase
Copy link

I like the idea of directional focus. The problem I'm starting to see is too many key combinations around win + arrow. I wonder if a tmux like approach would actually be better and offer unlimited feature adds. You hit a key combo (ctrl + b in tmux's case) to put yourself in nav mode then just arrows to focus on other panes. You want to also swap panes? Then another key combo will do that. To exit navy mode, either hit escape or wait 1.5 seconds.

@DerekRead
Copy link

@YAMLcase
I use Win+Tab to bring up the Windows equivalent of nav mode, then use arrows to move to the window I want and press enter. Seems to work great in combo with Fancyzones. All Windows stay where they are but the one you select is given focus.

I use this in conjunction with Alt+Space > N. This minimizes any window that I have given focus to but that I want to get out of the way. ie: if I have 3 windows laid out nicely in a FancyZone setup that I'm using a lot but I have a few other windows open. Unfortunately PowerToys overrides that standard Windows key combo and assigns it to "PowerToys Run" so if you want to use it too (it does make life easier) then you'll have to change the "PowerToys Run" shortcut or disable that feature. There's a couple of issues logged for this but they have all been closed as the devs feel they must use Alt+Space despite it being a long standing standard Windows navigation shortcut.

@YAMLcase
Copy link

YAMLcase commented Jun 15, 2022

@DerekRead That's still too much context switching :)

When I wrote my comment I was in the depths of developing a slackbot where I had my IDE on the right, cli terminal with python env running the slackbot to the left of that, and slack to the left of the python env. My workflow for rapid prototyping ended up being:

  • develop some bit of code
  • win ctrl left to focus the bot and ctrl-c; up arrow; enter
  • win ctrl left to focus slack and type some stuff
  • win ctrl right, win ctrl right back to coding

need to do some research?

  • win ctrl right to browser
  • alt d type in something like "how do i python again?"
  • tab; enter; tab tab tab tab tab down to the search results I want to read and enter
  • win ctrl left to get back to the IDE

I never had to touch the mouse or take my eyes off the relevant windows, never even had to move above the bottom two rows (except for the tab key).

@DerekRead
Copy link

@YAMLcase I wasn't really familiar with this kind of feature (as others have referenced systems I have not seen). But yes, while having all my windows shrink and then expand (my workflow) does work, it would actually be much nicer to be able skip the intermediary shrink/select/expand stage and just jump directly to another window. Far less distracting.

@shamrock01
Copy link

I'm personally a huge fan of the 4 directional arrow system. In that case, if we're already overriding the default snap shortcuts, why not use win + alt + arrows for switching focus between zones, since you probably don't want the snap top/bottom half shortcuts?

@rsmirnov90
Copy link

I am just coming back to Windows from Sway and am absolutely loving FancyZones, but I feel like the keyboard focus switching is a really crucial feature to a keyboard-centric workflow...

Perhaps even aside from the arrow-based navigation (which would be extremely useful), it may make sense to be able to navigate directly into a zone?

For instance, let's say I have 3 zones on monitor #1 and 4 zones on monitor #2. I could hit a hot key, let's say Win+alt+F (or something), and then type 12 to switch focus to the second zone of the first monitor. Maybe we could have a temporary layover pop up of all the numbered zones above the apps running within them for easy navigation when the user hits the hot key?

Thinking about it further, could we implement a similar approach for positioning as well? We already have something similar to position the window into a zone using the directional keys on the keyboard, so perhaps it would not be too difficult to enter a monitor & zone number to position a new window directly into a zone?

One of my biggest productivity boosts with Sway was never again having to alt+tab through 10 windows, and really never touch the mouse at all. It probably even offset all of the time I wasted tinkering with my Arch system when something else wasn't working 😅

I'd have loved to work on this myself but unfortunately don't know enough CPP...

@sethcalebweeks
Copy link

Just bumping this feature. It would be great to have.

@sgraf812
Copy link

sgraf812 commented Feb 8, 2024

People have repeatedly suggested Alt+Tab as a workaround in numerous cases, but it I find it insufficient.

I'm currently writing inside a Firefox window on Desktop 1. On Desktop 2 I have open a terminal (editing code of a web app, say) and another Firefox window (viewing that web app) in split screen, each allocating half of my monitor. I'm usually working on Desktop 2. Whenever I need to google something, I Alt+Tab to the FF window on Desktop 1, view the results and switch back to my terminal with Alt+Tab. So far, so good. But now I want to input into a form of my FF window on Desktop 2. I instinctively hit Alt+Tab once, expecting to be in the FF on Desktop 2, but actually I get sent back to Desktop 1. Then I remember and dreadfully have to scroll through the Last Recently Used cache that is Alt+Tab. And then again when I want to switch to the terminal.

(Please don't suggest to use the FF window on Desktop 2 for Googling; it's just an example and won't always be FF on Desktop 2. For example, I'm currently writing a paper in the terminal and view the PDF there. No googling in a PDF viewer.)

It would be less frustrating if I had the ability to bind Ctrl+Win+h/Ctrl+Win+l to switch focus between the same windows on the currently active Desktop 2. That's what we want! Modulo the keybindings of course, I can find a shortcut that's free myself. Though h and l are my preferred candidates, seeing that the default actions trigger features I will never use.

@sgraf812
Copy link

sgraf812 commented Feb 8, 2024

Here's how FancyWM computes the adjacent window in some direction: https://github.com/FancyWM/fancywm/blob/main/FancyWM.Layouts/Tiling/TilingNode.cs#L138 I couldn't find any kind of abstraction within FancyZones' code base that mimics the tree of TilingNodes in FancyWM, so that's probably the bulk of the feature here, i.e., constructing such a hierarchy after the fact and then selecting the correct window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FancyZones-Dragging&UI FancyZone dragging / interaction issue Idea-Enhancement New feature or request on an existing product Product-FancyZones Refers to the FancyZones PowerToy
Projects
None yet
Development

No branches or pull requests