dgurkaynak / Penc

Trackpad-oriented window manager for macOS
https://deniz.co/penc/
MIT License
1.11k stars 25 forks source link

Suggestion: Keyboard arrow support #36

Open ReinBentdal opened 2 years ago

ReinBentdal commented 2 years ago

Sometimes it is inconvenient to use the trackpad. For example if using external keyboard and mouse. Would be nice if it would also support resizing and docking with arrows for the currently active window.

Usage example: Doubletap command + arrow left -> docks currently active window to left

I personally use drag up for fullscreen and drag down for 1/3 width and height. With this feature this would result in the same behavior with arrow up and down.

Also possible to use diagonal gestures with for example first pressing left key and then press up key. Then if you instead want to use up-gesture, press up key again. Or if you press left key but regret, press right key to go back to initial state. Then press right key again to dock to right. Makes sense?

Anyways just spewing out my thoughts here.

dgurkaynak commented 2 years ago

Hey @ReinBentdal, I silently added a very similar feature in v1.0. When you activate Penc and select a window, you can use keyboard arrow keys to snap the window. Arrow keys just mimic whatever your 2-finger swipe gestures do. Is this what you're looking for?

I think the only drawback of keyboard usage is, when you double-tap command key to activate Penc, the window under the mouse cursor is selected automatically. This behaviour is intuitive for trackpad/mouse usage, but for keyboard usage, the focused window should be selected instead 😕 But how can we differentiate between these use cases? As a workaround, I'm imagining pressing tab key to switch the selected window, but I'm not sure it's possible, since cmd + tab is a system-level shortcut.

ReinBentdal commented 2 years ago

Wow can't believe I missed that, yes similar to what I wanted. Maybe possible to initially select current window and rather change to whatever the mouse is hovering over when the cursor position changes. So if you keep the mouse still, you can change the currently active window position. Would also be nice to implement, as you said, the tab feature.

Another suggestion: while in mission control, if you active penc (double tap CMD), it will also work here. Then using tab to select a window. And for gestures, as usual use mouse to select window and drag it. When you them release CMD, exit mission control and view specified window configuration. Maybe hard to implement?

dgurkaynak commented 2 years ago

I like the idea that initially the focused window would be selected, but as soon as mouse moved, it switches back to selecting via cursor 👍

I think Apple doesn't allow any app to draw on top of mission control view, but not 100% sure