Page MenuHome

Trackpad: Allow changing the speed while fly navigating
Needs ReviewPublic

Authored by Yevgeny Makarov (jenkm) on Nov 24 2020, 3:52 PM.

Details

Reviewers
None
Group Reviewers
User Interface
Summary

The code is already here, it was just lost during refactoring earlier.

This feature was added in rB4737e08cb9a5 and in rB3064da1200a9
keymap was lost, just because it wasn't added to the fly_modal_keymap
initially. This patch just adds FLY_MODAL_SPEED to modal map
so it can be selected in the keymap.

Also replace 'delta' with proper 'absolute delta'
so that the upward movement always increases the speed,
regardless of the Natural Scroll Direction preference.

Diff Detail

Repository
rB Blender

Event Timeline

Yevgeny Makarov (jenkm) requested review of this revision.Nov 24 2020, 3:52 PM
Yevgeny Makarov (jenkm) created this revision.
Hans Goudey (HooglyBoogly) requested changes to this revision.Nov 25 2020, 10:14 PM

Although I don't doubt that this works (can't test it right now), I don't think we can accept this without more information. Which refactoring? Why did the refactoring make it stop working? Why do you have to add another entry to the modal map if the code was already there? What's the big idea of your changes to make it work?

It's the responsibility of the patch description to answer these basic questions, and I think in the end it will save everybody time if it does. For instance, someone in the future wondering why there is a "SPEED" value in the modal map but also "ACCELERATE" and "DECELERATE".

This revision now requires changes to proceed.Nov 25 2020, 10:14 PM

Oh, if you look at the patch, which is only three lines long, you'll see that FLY_MODAL_SPEED is already here.

This feature was added in this commit rB4737e08cb9a5: Added trackpad (and magic mouse) support to control speed in Fly Mode in 3d.
In this commit rB3064da1200a9: Keymap: move builtin keymaps from C to Python its keymap was lost, just because it wasn't added to the fly_modal_keymap initially.
I just added FLY_MODAL_SPEED to modal map so it can be selected in keymap.

"ACCELERATE" and "DECELERATE" are used for the Mouse Wheel Up/Down or the Plus/Minus key, it's just a step.
"SPEED" is for the Trackpad Pan event, which has a Delta value, and can both increase and decrease the speed.

Yevgeny Makarov (jenkm) requested review of this revision.Nov 25 2020, 11:23 PM
Yevgeny Makarov (jenkm) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) retitled this revision from Trackpad: Allow to change the speed while Fly navigating to Trackpad: Allow changing the speed while fly navigating.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)