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.

thank you! i will implement this and see how it goes.

i cant quite figure it out on my own here… have u got any tips or examples? would be greatly appreciated

if event is InputEventMouseButton and event.button_mask & MOUSE_BUTTON_MASK_RIGHT:
	# do stuff with event.relative

ahh i see!!! thank you