How to change mid mouse button function for a keyboard key?
I use blender with a wacom pen and no mouse.

In the System preferences > Input section I enabled Emulate 3 Button Mouse.

On the interface I drag the pen while holding:

Ctrl Alt to zoom in or out.

Alt to rotate.

Shift Alt to move up down or sideways.