How to rotate Area2D upon clicking and holding

Godot Version

4.6.3

Question

I’m trying to create a rotatable light beam as part of a light mixing puzzle in my game. The player is able to turn on the light by walking onto a button that will project the light. I want to add onto this by allowing the player to move the light beam within a specified range of rotation (from -15 to 15 radians). The player should be able to do this by clicking and holding/dragging the light into the desired position. Then when the player releases, the light should stay and face the direction in which they dragged it.

What I have so far properly positions the beam according to the direction of the player’s mouse, but I would like to add in that this functionality should only exist when the button is clicked and stays when the left mouse button is released.

func _ready() -> void:
    input_event.connect(_on_input_event)

func _on_input_event(event: InputEvent) -> void:
    if event is InputEventMouseButton:
        look_at(get_global_mouse_position())

Also here’s a visual of what the button and light beams look in the current prototype if that’s helpful: