Detent on only when switch action shift encoder toggle/hold is on?

Detent on only when switch action shift encoder toggle/hold is on?

Is it possible to change a knob to have detent on only when switch action shift encoder toggle/hold is on?