Because of LeChuck, you can't walk close enough to the key to grab it with your hands.
And LeChuck won't go away.
You're going to have to grab the key with something other than your bare hands.
What is the key made out of?
Metal, perhaps.
Some metals have a peculiar trait.
Think "opposites attract," and I'm not talking about electricity.
Opposite magnetic poles attract.
And some metals are magnetic.
This key, for one.
If you had some sort of strong magnet, you could pull the key of the wall.
But you do have a magnet!
Have you looked at all the items in your inventory?
Stan may have helped you out again.
Look at the warning on the magnetic compass.
It contains a strong magnet.
So the magnetic compass could attract the key.
Use the magnetic compass on the key, and the key will fly over to Guybrush.