you don't mention what year your boxster is and i don't know if or when the key design changed. on my boxster, MY2000, the metal key was held in the plastic case by a sort of plastic pin. i did a quick search and found a picture of an aftermarket fob. it isn't identical to the original one but close enough. on the half that is on the right side of the pic, you can see a spring loaded peg or pin. i seem to recall (it's been 10+ years) that holds the metal key in the plastic fob. this is probably missing or broken in your case. i'd split open your fob and have a peek.
--
MY 2000 S, Ocean Blue, Metropol Blue, Savanah Beige.
Bought June 2000 - Sold May 2010