Midi fine tune / midi slew/smoothing

is there a way to use an endless encoder in such a way that if i hold down a particular keyboard key or button on midi controller that the coarseness or “fineness” of the knob i’m turning can change? would love to slowly fine tune something or quickly get within a range of values quickly by changing the knob sensitivity/coarseness etc…

also have same question but with standard 0-127 midi knob instead of endless encoder…