Disable Controller Rotation Yaw on event?

I want that when I am sitting on a chair I would disable Controller Rotation Yaw. Please how to do this

Found the solution.