Lock a specific plane for rotating or translating only

I’m currently building a module for CT analysis. I’ve managed to do quite a bit and am in the process of refining it. I already created planes, rotated and centered them, added custom measurements and plotted a way to get the 3D view to rotate perpendicularly to the plane to get the correct C-arm views.

I would now like to lock a specific plane from rotating or translating. Specifically, I need to stop the sagital and coronal planes from rotating, and the axial plane from translating. How can this be done with python for the module?

You can customize what actions and mouse&keyboard gestures are available for each view as shown in examples in the script repository.