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

Bug: Holding down modifier key prevents default click behavior #1801

Closed
Subjective opened this issue Jul 12, 2023 · 7 comments
Closed

Bug: Holding down modifier key prevents default click behavior #1801

Subjective opened this issue Jul 12, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Subjective
Copy link

I use option as my modifier key, which works fine for the most part. However, when I need to hold down option to click on an item in a context menu (e.g. the finder app's right click menu), the click fails to register. Since the only use case for the modifier keys is holding down click to drag while resizing/moving windows, would it be possible to differentiate clicks from dragging? Thanks.

Screen Recording 2023-07-12 at 2 47 06 AM

@egrefen
Copy link

egrefen commented Aug 31, 2023

👍 to this. I have ALT-click+drag to move windows in yadr, and this inhibits ALT-click on, say, menubar items (to show extended menus). It would be awesome to be able to differentiate these.

@koekeishiya
Copy link
Owner

Probably best solved as explained in #601

@mattbailey
Copy link

I've had similar weird interactions when I set my mouse_modifier to cmd trying to cmd+click links into new tabs. Not a specific fix for your problem, but I ended up using hidutil to remap right_control to fn and having yabai use fn as the mouse_modifier since that seems to have the least undesired interactions.

gist here: https://gist.github.com/mattbailey/9429c7691467bf82d64e1900c99fb53b
generated with this tool: https://hidutil-generator.netlify.app/

@dobladez
Copy link

dobladez commented Feb 21, 2024

Wouldn't it be possible for yabai to capture the click only when the action is dragging (at least for windows move/resize) ?

@koekeishiya
Copy link
Owner

koekeishiya commented Feb 21, 2024

It's not quite that simple.

"Dragging" in macOS can only take place when a mouse button is held/pressed/down.
The feature in yabai is built around the events reported by macOS, which for any drag-operation first consists of a mouse-down event, followed by one or more mouse-drag events, until a mouse-up event takes place.

For "click anywhere" to work, yabai needs to intercept the initial click event that is reported before the drag events begin.
These events are reported in the same thread, in sequence. yabai cannot side-step the click, wait for a drag event to come in, and then tell macOS to void (make a no-op out of) the previously performed mouse-click.

The best that I can think of would be to replicate the click if no drag-events occur in between the mouse-down and mouse-up event.

@dobladez
Copy link

Thanks!

@koekeishiya
Copy link
Owner

New change somehow randomly causes segfaults... Not completely sure why, code looks fine to me, but w/e easy fix.

@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Feb 22, 2024
@koekeishiya koekeishiya reopened this Feb 22, 2024
@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants