On the Microsoft Wireless Comfort 5000, there should be an "F lock" key to the right of the F12 key as shown here:

This key acts as a toggle, switching the function keys between the specialty features of that keyboard (such as the print function shown on F12) and "normal" function-key operation.
So if a function key doesn't work in-game, press the "F lock" key and then try it again and it should work.
Good luck and happy adventuring!