How to write a Custom Movement Mode?

Thank you very much! As I thought, there was a simpler solution. I’ll be trying it after work.