Hi,
I find the mouse_actions using mouse_modifier in yabai is very useful. However utilizing both the actions together is not very convenient when using only the trackpad. I am forced to limit usage only to one action.
Context:
I am using tapping fingers on trackpad for click and sliding fingers for drags. i.e using one finger tap for left click and two finger tap for right click. Doubletap & slide to click and drag and two finger slides for scrolling. Right click drag is not possible by doubletapping with two fingers and draging. It can only be done by pressing down with two fingers on the trackpad and sliding (which is not very friendly as you have to keep up the pressure while sliding the fingers on the trackpad. In most cases you lose the right click drag in between due to lose in pressure or accidently lifting one finger).
Question / Request
It would have been more convenient to use two different modifiers to do different actions (move and resize) using the same mouse button. For example: Hold down _fn_ key and left click drag for moving windows and hold down _ctrl_ key and left click drag to resize windows. Is this currently possible in yabai?
In case it is not, can something like this be implemented?
mouse_modifier1 fn
mouse_modifier2 ctrl
mouse_mod1_action1 move
mouse_mod1_action2 off
mouse_mod2_action1 resize
mouse_mod2_action2 off
Regards,
John
This is not currently possible. I think a better option would be to essentially remove the need for mouse_action1/2 in the yabai config and expose them through the command line IPC instead such that they can be bound to whatever through an external application, just as any other action.
I made a proof of concept patch here. Usage is like
yabai -m config mouse_actions 0 fn left move stack
yabai -m config mouse_actions 1 shift ctrl left move swap # uses shift+ctrl as modifier
yabai -m config mouse_actions 2 fn right resize # no drop action
I removed the original mouse_action1, mouse_action2, mouse_drop_action, modifier settings as this would generalise them all.
@koekeishiya If this approach is acceptable, what would I need to do before making a pull request? Also this is a different branch from my earlier pull request with the legacy move action so hopefully it's in keeping with your project direction!
I'd rather move them into commands as briefly mentioned in my comment above. I imagine something like yabai -m window --drag move.begin|move.end|resize.begin|resize.end. These can then be bound to whatever key, mouse, gesture using some external hotkey software.
Would skhd support mouse buttons when this lands?
Probably, yes, as well as key-release triggers.
I'd like to add one more suggestion - maybe you already plan to include this, maybe not. I use FlexiGlass for move/resize on Mac right now, but I'd rather use yabai :)
Would it be possible to model this behavior? Two modifiers (e.g., ctrl+cmd), and then one finger moves and two fingers resize.
Thanks for chunkwm and yabai, I love them when I'm not in linux!
It would also be nice to change mouse_drop_action based on what modifier key is being held when mouse is released. I was wanting to use the stack mode while holding the shift key and releasing a window on top of another to stack them but it seems like it's either swap or stack for mouse_drop_action.
Most helpful comment
I'd rather move them into commands as briefly mentioned in my comment above. I imagine something like
yabai -m window --drag move.begin|move.end|resize.begin|resize.end. These can then be bound to whatever key, mouse, gesture using some external hotkey software.