Giter VIP home page Giter VIP logo

Comments (3)

noah-nuebling avatar noah-nuebling commented on May 18, 2024

Hey there McPo, thanks for your feedback, I'm glad you're liking the software! :)


TLDR: It's complicated and I won't be able to help you with that issue soon, but it's on the agenda and I really hope to release something that works for you at some point in the future. Please don't get your hopes up, though, as I don't have too much time to work on this.


Why it's not so easy

Let me give an example: If, let's say, you have mission control mapped to clicking mouse button 3 and then you hover over a tab in safari and click mb3, then the tab will be closed (that's what mb normally does on tabs) and Mission Control will be triggered, both at the same time.
This is a really bad user experience. You might not even notice the tab closing cause your windows are moving around at the same time.
Generally, whenever you would use mb3 to trigger Mission Control you'd have make sure that mb3 is not also doing something else in the context you're in.
This would not be alleviated by letting Mission Control trigger when you hold the button, or on the mouse up event like you suggested.
Because to input anything involving mb3, a mouse down event has to occur. And when these mouse down events have other effects, you would trigger these other effects, too, when you try to open Mission Control.

The solution

So we've established that we don't want any of the original events bleed through to other programs.
But what we can still do to allow the user to use the original effect of mb3, is to fake a mb3 input, which consists of a mouse down and a mouse up event, after we are absolutely sure that the user wants to trigger a click input and not a hold input or something else.
(This is really the main idea here. We want the user to be able to trigger specific effects, without having to inadvertently trigger other side effects.)

This is already implemented for click inputs (but not click and drag inputs) in the current Mac Mouse Fix version, and it's what happens when you assign 'Middle button click' to clicking the middle button.

As a sidetone, here's a description of what it does:
Let's say you have the middle button set to "Middle button click" and holding the button set to "Mission Control".
Now, when a mouse down event occurs, for reasons explained above, we block that input. Other apps can't see it at all.
If, after that mouse down event, a mouse up event occurs within a certain timeframe, we recognise that as 'The user has clicked mb3' (If the click doesn't occur within that timeframe, we see that as click-and-hold)
So since the user has definitely clicked - and not held - the button, we now want to trigger what ever effect they've assigned to clicking the button. In this case, the action is "Middle button click", so we will send both a mouse down and a mouse up event to the underlying app in quick succession.

We're tricking the app into thinking clicked mb3 - after you actually clicked mb3.

And while this won't behave the exact same as really clicking the button - the effect will be slightly delayed - it's close enough to where most people wouldn't notice, and it works just fine for most cases.

So we've found a way to allow the user to utilise the original click effect of a button in a way that works in the context of other effects assigned to that button. Great!

We can do a similar thing for click-and-drag inputs, but it's a lot more involved. I won't go into detail here but I think most of the important ground work is layed in the advanced remapping code you can find in the 2.0.0 branch. If someone wants to have a go at it, from my understanding, all you'd have to do to make this work is to add a ModifiedDrag type of fakeDrag (or some name) which produces a mouse down event when the modified drag's activationState switches to kMFModifiedInputActivationStateInUse and a mouse up event, when it's deactivated)

I've also thought about doing something similar for click and hold input, but I've come to the conclusion that it's impossible.


I hope this I somewhat understandable, I'm having a hard time explaining this stuff, but I really tried. Please ask if you would like me to clarify anything.
I also hope you don't mind that I rephrased your Issue title and your problem a little bit. If you feel like I'm not getting something quite right, please let me know!

from mac-mouse-fix.

noah-nuebling avatar noah-nuebling commented on May 18, 2024

Hey there @McPo, I think you'll be quite pleased to know that, you can now properly use Mac Mouse Fix with Blender in the new 2.0.0 Beta!

To enable Click and Drag Middle Mouse Button in Blender while using it the Middle Mouse Button with Mac Mouse Fix, you can:

  1. Add a row in the remaps table with a trigger of "Click and Drag Middle Mouse Button". To do this, click on the "+" button below the remaps table and then click and drag the Middle Mouse Button over the "+" field.
  2. Hold the Option (⌥) key to reveal the "Click and Drag Middle Button" option and choose it.

(You can also do step 1. on another Mouse Button or while holding a keyboard modifier for more options.)

Here's a video demo:

Screen.Recording.2021-03-31.at.22.38.56.mov

If you have any more questions or experience any troubles or have any ideas on how to make the user experience for this better (I know it's not very intuitive right now), please let me know! This is a pre-release and I'm still thinking about how to present all of this.

Edit: Unfortunately, you can’t combine this simulated click-and-drag with keyboard modifiers which is pretty essential for using Blender. This issue is pretty deep in the architecture of the remapping engine. Changing it is a lot of work and very likely to introduce new bugs. So I won’t be able to fix this soon, unfortunately. You’ll just have to turn Mac Mouse Fox off when using Blender for now.

from mac-mouse-fix.

szhu avatar szhu commented on May 18, 2024
Background

Hi @noah-nuebling, thank you for your work! This app is incredibly helpful already as is.

I ran into an incompatibility with one tiny part of my workflow, which is how I found this issue. Like OP, I want to be able to use shortcuts with my middle mouse button, but also want to retain middle-drag-to-pan functionality in a canvas app (for me, Figma).

I tried following the instructions above and got stuck here:

  1. Hold the Option (⌥) key to reveal the "Click and Drag Middle Button" option and choose it.

Has this feature been removed? I'm on the current stable version, 2.2.3, and when I hold down Option, I don't see the "Click and Drag Middle Button" option. I only see "Mission Control and Spaces".

Things I've tried

I am unable to verify if this feature existed when you made the comment because macOS thinks all the beta version from last year are malware and refuses to open them.

I am aware that you are working on version 3 at the moment. I tried it and found that it comes with an option to navigate when dragging. However, the direction of the resulting movement is opposite what I am used to, and so that doesn't work for me either.

Thanks again for your work. I appreciated that you created a dedicated label for all the of the issues surrounding this topic, lol :) Apologies if there is any important info you wrote in a later issue that I missed, let me know if that's the case.

from mac-mouse-fix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.