-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Mouse movement constant factor/multiplier keys to instantaneously change speed #2206
Comments
I just noticed that an interesting property falls out of this design if you set something like
and
Now, if you only hold one speed-modifier key at a time, it effectively sets the speed to its parameter
which is generally easier to reason about, though the total speed gets enormous if you hold multiple of these at once. Perhaps an alternate proposal could be to make the speeds additive instead of multiplicative, so you would have a |
I think multiplier makes more sense to me as well, and is easier to reason about in general. In order to solve the slow down issue with integer params, I'd propose a fractional approach:
I don't know if it makes sense to fold this into |
Can you expand more on the fractional idea? It sounds likely to be clearer than mine but I don't understand the specifics enough. Are those properties set once on e.g.
I just edited the description slightly to clarify that this really applies to
Composition! We love to see it. Does this address your concern? I'm also not terribly familiar with how the |
My concern is more with pointing devices that you don't use
I propose this as an alternative to setting a base multiplier like
Which would also multiply pointer speed by 2/4=1/2. But there is more intricacy here, you probably want this to affect only one device. If you want to change the speed of
|
I missed that such multiplier/divisors already exist in the input listener device, so the values from a new "modifier" behavior might simply compose with the existing listener settings during runtime. |
If I understand correctly, the input-listener multiplier/divisor is applied right at the beginning of the process (via I'll work through more specifics later, but the short version of an updated proposal would be: define new codes like |
Here is my version of |
I tried @badjeff 's implementation and it resulted in odd behavior with my cirque/glidepoint/pinnacle, the motion was off-axis and not scaled as expected. Since @seansfkelley your version was mouse keys only, I put together this behavior hack into input_listener.c, I doubt it follows any style guidelines at all and won't generalize to mouse keys, but it works for defining a behavior in your keymap with replacement |
Background and Use Case
I currently use a fork of ZMK that includes #2027. I use constant-speed mouse/scroll movement (exponent 0, time-to-max 0), which I find much easier to control. The downside is that it's a poor fit for handling both precise movement and large screen movements.
In QMK, I resolved this problem using the different cursor speeds offered by the
KC_ACL{0,1,2}
bindings. The cursor had four speeds (including the default, unmodified one) and holding a key for the alternate speed took effect immediately, without moving any of your other fingers or lifting them off their keys.In the version of mouse movement in #2027 and (I think) #778, it seems like the only way to get different mouse/scroll speeds at different times is to use different keys, possibly on different layers. This is pretty awkward when you're used to using just WASD to move the mouse around, and doubly so if you choose to put those alternate speeds on a different layer -- both methods require lifting and moving the fingers being actively used for the movement, which feels a bit like having multiple gas pedals in your car for different speeds.
If I've misunderstood, and there is a way to get my desired behavior with some clever usage of macros, I'd love to hear it! Composing a solution out of the existing parts is preferable.
Assuming not, here is a proposal. I would be happy to open a PR as well if you think this is a good idea. My fork already has more primitive prototype of this behavior implemented and working.
Proposal: Speed Multiplier Keys
#define
a new type of thing that can be provided to anyzmk,behavior-input-two-axis
(but I'll use&mmv
as an example for the rest of this):This would double the speed of any other
&mmv
keys that are held while this key is held. Multipliers would combine... multiplicatively... so if you held more than one such modifier you would get a speedup proportional to their product. This factor would be applied as the last step, after all other acceleration, exponent, etc. math has been performed to compute the current tick's delta x/y.The lack of floating point (and please correct me if I'm wrong about that) makes defining slower-than-default speeds awkward. Instead of defining a multiplier [0, 1) and being done with it, you could instead define a "base" multiplier that is ignored if other multipliers are active:
This means that all speeds are multiplied by 4 by default, unless any other modifiers are held, in which case those held values are used instead. In the case of 4, this means slower speeds could be 1/4, 2/4 or 3/4 of the "base" speed. It also means that the numbers in your keymap have to be 1/4 as large as you think. (This value could be a regular constant instead of a behavior property as well.)
As an implementation detail, it would probably be best to change the underlying two-axis behavior to accept two parameters instead of one. The speeds could remain bit-packed into the first, and the second would be used to communicate the multiplier, if present. The
MOVE_X
(etc.) macros would change to hardcode a 0 or sentinel value for the second parameter, so you could still do e.g.&mmv MOVE_X(500)
and it would continue to work.It seems unlikely that this behavior would be composed with non-linear or non-constant two-axis movement configurations, but it would have well-defined semantics if so.
The text was updated successfully, but these errors were encountered: