"Resize window below cursor" only resizes from bottom-right.

Not exactly the same, but similar.

You need three actions

(1) "move mouse...".
(2) custom left click (down only)
(3) custom left click (up only)

(1) moves the mouse to the left, right, top, bottom corner/border of the front window.
(2) click and hold clicked.

Now you can resize the window by moving the mouse.

(3) release the left click. Back to normal.

This can be activated with any BTT trigger (shortcut, gesture...). With a cycle action the same trigger can be used to enable and disable resizing.

3 Likes

That's actually a pretty good solution.
Here is an example config that resizes windows from the top left while holding cmd+d:
Example Preset


2 Likes

Hi Andreas, have you tested this?

The problem is that BTT stores the click position of the front window incorrectly when the window is moved. You said this has something to do with the y value and that you want to fix this. :slightly_smiling_face:

1 Like

The y issue is only for the BTT window, no? (just enter x 0 and y 0 and it should work for other windows)
But it's fixed in my local build anyways :smiley: will release that tomorrow.

1 Like

Unfortunately not :man_shrugging:

Mhh ok, then wait until the new alpha tomorrow is released, it's working pretty well here :slight_smile:

1 Like

For me, "move mouse and click" does not work properly in relation to the front window in any app when the window is moved. Is it really just me?

no probably not - as said I fixed it in the version I'm running on my local machine already. That's why I might not have noticed the issue anymore while testing this. The fix will be released tomorrow!

1 Like

:+1: :grinning:

1 Like

Interesting idea, thank for sharing!

Can this be used to:

  • get mouse position
  • get window position/dimensions
  • compare
  • fire up an action based on ↑ comparison

or is this beyond BTT's capabilities?

Otherwise am I correct that I'd need 9 shortcuts to cover the 9 areas in the picture above?

Check out this improved poor man's substitution to the awesomeness of one key trigger in AltSnap:
Sets the following triggers: fn+

  • Top: Q/W/E (←↑→)
  • Middle: A/D (← →, no middle as you don't resize anything there, but you can set it to move action if you want)
  • Bottom: Z/X/C (←↓→)

Then as long as you hold them, you can resize the window with a touchpad

Downsides:

  • needs many keybinds
  • you ←→↑↓ alignment isn't perfect as you can't set a 50% of window width mark, so I've chosen approximate 400 pixels for ←→ and 200 for ↑↓
  • anything else?

PS
Is it possible to group the keyboard shortcuts in the list? For example, I'd like to have all of these 18 keybinds to be grouped together visually under one header (that I could also collapse)

ResizeFromSides.bttpreset (40.1 KB)

Same as ↑ but with fnS to move a window
ResizeFromSides+Move@C.bttpreset (40.7 KB)

I don't know, I haven't tested this, but maybe there is a way to use only one shortcut with the Advanced Conditions, eg if the mouse is in the upper left corner of a window, then resize the window from there. So you would have to move the mouse to the desired location first and then use the shortcut.

@Andreas_Hegenberg [Andreas_Hegenberg] should know the full power of his tool, so let's wait for his response
I'll meanwhile use the 9fn script as that seems to still be better than being able to only resize from the bottom-right

Yeah, that'd be much better!

I see there were some hacks provided in this thread, but what of @vurt's original request? Could this be part of the built in "resizing modifier keys" feature?

1 Like

Sorry, I think this is too hacky to be included as a standard feature.

that's rather unfortunate as this is the best way to resize a window

Would you at least let us know whether it's possible to have a single shortcut instead of a dozen? Can I bind a shortcut depending on the cursor position relative to the window, so that the same shortcut would

  • resize top left corner if the mouse is in the top left area of a window (with user configurable width/height %)
  • resize bottom right corner if the mouse is in the bottom right area of a window

Also, is the following workflow possible:

  1. enable resizing on some type of mouse click
  2. move your mouse to resize up to whatever you like
  3. use the same click as in 1. to finish the resizing and exit the workflow

I'm using key down / up events as triggers in the workflow above, but that requires holding down the key. Instead I'd like to have some kind of set variable true on first key press and then the second key press would only activate if he var is true and then change it back to false or something similar
I briefly looked into trigger variables, but couldn't find custom user vars for that, only system ones that contain some info on mouse position etc., but could've easily overlooked something

(Karabiner elements has this custom user var feature for exactly these types of workflows, and it's great to be able to have these custom conditions in keybinds)

Lastly, is it possible to set mouse position in % of window width/height rather than using absolute pixels?

I'm really no expert on such things, but I think the answer to most of your questions is yes.

But do you always know where the mouse is when you use a shortcut?

I haven't tested this, but spontaneously I would say there are more intuitive solutions if you want to use the keyboard.

Example: ⌥+s activates the "window mode". ⌥+s+a/d stands for left/right. ⌥+s+w/x stands for up/down. This can be fine-tuned as you like and should be possible with Key Sequences.

Not on my computer today, but this might help:

I don't need to know that, that's what the script fill figure out for me

[quote="Frank1, post:23, topic:10976"]
Example: ⌥+s activates the "window mode". ⌥+s+a/d stands for left/right[/quote]

This isn't more intuitive, left/right from which side of the window?

Yes, it does, thanks a bunch, much more convenient vs having to use 9 keys (though those are still included for those cases when you don't want to use a mouse)! This is much better (made a simplistic split by 3rds, though corners should arguably be smaller, need to use it more to see what % is best)

Then the only things remaining are:

  • (major) convert this into a sequence, so you can trigger, resize/move, click (or shortcut) to exit instead of holding a button all the time. Requires being able to bind any key to a trigger "AnyKey" to cancel a given action
  • (major) fails for overlapping windows as you can't move to a window's border if it's in the background

So it seems that the only proper way is to ask to add part of the original feature that would allow scripts to actually resize some specific window side (the detection logic for which side exists) instead of simulating buggy mouse pointer clicks

ResizeFromSides+Move@C.bttpreset (136.0 KB)

Updated version with JS with a much easier matching than having to enter the same conditions manually in every action
Now it's a single on-key-down action (and reset on key up) instead of a dozen
This also allows maintaining mouse X position when you only need to move vertically (and vice versa)

Resize@:mouse2:pos.bttpreset|attachment (53.9 KB)