Open l16r opened 2 months ago
Hi @l16r! Sorry for the delay. You cannot bind an empty set of keys. So unfortunately, you will need to specify some key in addition to the command modifier.
For combining the drag event, you can do something like this:
Key.on('command', 'q', () => {
Event.on('mouseDidLeftDrag', () => {
// Move window
});
});
@l16r if it helps, feel free to use my implementation for inspiration: https://github.com/mafredri/phoenix-config/blob/af7ee9657a14eb70cb69652ccd1849faf327dc09/src/phoenix.ts#L26-L146
It works like this:
hyper
= cmd+ctrl+alt
hyper + a
and keep holding hyper
to activate window movement (you're free to keep holding a
too, but it's optional)hyper + shift + a
and keep holding hyper + shift
to activate window resizehyper
, you can release or press shift
to swap between move and resizea
again, or release hyper
to deactivateI never polished it, so it has some rough edges but works pretty well most of the time.
(Behavior is triggered by mouse movement only, no press or drag.)
I want to implement functionality that allows the window to be moved without clicking the title bar. My idea is to register a drag click while hovering over a window and a modifier key (e.g. "command") being pressed and then move the window position relative to the mouse position in comparison to the start. The behavior is similar to the one implement by dwm. However, I don't want to require any key to be pressed other than the command modifier key. Trying to achieve this behavior in the following manner does not work:
And how can I connect this to the
mouseDidLeftDrag
event?