Are we talking about a laptop or a desktop keyboard? What model are you using?
Glue shouldn't be the first thing you try as it can damage the board underneath the keys if not used correctly. Usually the key tops fit onto a "carrier" or latch underneath and you have to slide in the key top the right way before pressing down to click into place. Is the key top damaged? If so you may need to buy a replacement.
See example for Sony Vaio laptop