The sunshade can be opened and closed by hand.
The sunshade opens automatically when the moonroof is opened, but must be closed by hand.

CAUTION
Jam-safe Moonroof
Security SystemMazda 6 Owners Manual: Instrument cluster configuration
1. Connect the SST (WDS or equivalent) to the DLC-2.
2. Input vehicle information following the directions on the screen.
3. Select Module programming.
4. Select Programmable module installation.
5. Select the following items and perform procedures according to directions
on the screen.
...
Mazda 6 Owners Manual: Operation
System triggering conditions
The horn sounds intermittently and the hazard warning lights flash for about
30 seconds when the system is triggered by any one of the following:
Unlocking a door with the key, door lock switch, or an inside door-lock
knob.
Forcing open a door, the hood or th ...