conditions containing input events

Godot Version

godot 4.6

Question

Hello! I am relatively new to Godot and programming as a whole, so please excuse me if this is a silly question.

I am trying to create a camera system that is controlled by the players! Right now, I have code that captures the relative position for the mouse motion, but I am just unsure of how to capture the mouse motion/relative position only IF the right mouse button is being held.
Of course, I have tried many things myself and did learn some stuff on the way, but this has got me stumped. Thank you in advance for any help I may receive!

Mouse event objects have button_mask property. You can test this for button states.