Cosmic Key is a fictional device from the Masters of the Universe film. It is a device that allows anyone to travel anywhere in any dimension, Skeletor managed to obtain one device, it's creator Gwildor was able to make another.
A life-size toy version of the Cosmic Key was planned by Mattel, but the toy line was cancelled before it could be made.
However in the 2016 line it was created and came with Gwlidor, and also Preternia Diguised He-Man
The minicomic The Cosmic Key has He-Man and the Sorceress of Castle Grayskull call upon the inventor of the Cosmic Key, Gwildor, because they think he is the only one with the ability to send the Evil Cloud back to its own dimension, by using the power of the Cosmic Key. Gwildor uses the power of the Key to send the Cloud to the far reaches of the universe.
In the final two issues of the Marvel Comics series based mostly on the 80's Filmation Cartoon, Prince Adam loses his sword to a time warp, forcing him to time travel into an alternate future where Skeletor has conquered Eternia. Encountering his older counterpart, Adam learns that Skeletor was able to accomplish this using the Cosmic Key, along with He-Man's absence. Among the things he was able to accomplish with it were the sealing of Eternia's dimensional borders, keeping a visiting Orko trapped in Trolla as well as keeping both the heroes and villains of Etheria from intervening. These two issues were notably more serious in tone than the rest of Marvel's adaptation.
Live action movie
The Cosmic Key is a device that was first introduced in the Masters of the Universe film, it allows its owner to create portals to anywhere. It was built by Gwildor.
Gwildor was tricked by Evil-Lyn into giving her his prize creation The Cosmic Key to Skeletor, and thus allowing them to enter Castle Grayskull and take over Eternia. As the unwitting cause of Grayskull's defeat, Gwildor endeavored to help He-Man overcome Skeletor by using a prototype Cosmic Key. When the heroes found themselves overwhelmed by Skeletor's army, Gwildor uses the Cosmic Key to help them escape, and the heroes are transported to Earth, leaving Gwildor faced with the task of finding the correct programming on the Key to transport them back before Skeletor gains the power of the universe.
The Cosmic Key is a complex device with numerous switches and buttons, which can be used to programme sonic waves, sounds, music and light patterns which serves to transport its users to the location of their choice.