Lock the workspace to 2 axes

Hello. A similar thing has been asked here a while ago. Here’s an answer I provided back then.