Any key on the keyboard is a simple design that includes a spring element and retainer. The first provides the keystroke, the second keeps it on the keyboard. If both are OK, just insert the "legs" on the inner sides of the keys in the designated grooves on the keyboard and press lightly to ensure that key fixed.
When one of the items broken most often this happens with "legs" in keys not rush to throw away the broken off parts. Gently apply between the parts of the broken parts of glue and wait until it dries. Then insert the key into place as described in the first step. Be careful, if the layer is wet, the adhesive will to detail, you can seal and spring element, then the spacebar will no longer be held down.
If part of a key cannot be recovered at home to treat this problem in service center not in all cases rationally (except the laptop). Sometimes it's easier to buy a new keyboard, especially as prices for this type of device is relatively low. Before buying, make sure that the keyboard connector is suitable for your computer. If required, additional purchase the adapter.
Until then, until the new keyboard is still not bought yet, you can use for typing virtual keyboard. To do so, click "start" or Windows button, expand all programs menu and locate the folder "Standard" subfolder of the "Special opportunities". Click on "Onscreen keyboard". When the utility window opens, select the marker item "always on Top" in menu "Parameters".
With these settings, the virtual keyboard will not disappear behind other Windows. You can continue typing on the regular keyboard and the code will need to put a space character is to use its virtual counterpart. Also always fashionable to copy a space to clipboard and paste it in the right places and With the Ctrl keys or the Shift and Insert.