Middle mouse button locking

I use 3d graphics software that has you press middle mouse button to pan around. Pressing and holding the middle mouse button for longer periods of time unfortunately puts a lot a strain on my wrist.

I heard something about some feature where you can press a button and keep the middle mouse button down until you press it again.

I don’t know if it’s software programmable or it’s available on some mice with dedicated button. If so what are some examples of mice that support this feature?