I have a Nikon D90, it is an amazing camera at a reasonable price. I have tried a D700 and a D3s, both incredibly awesome cameras, but just a bit too expensive for my needs.
If you can get your hands on a second hand D90 in good condition you should be golden as long as you have a macro lens, you can get decent macro lenses very cheap as well, even brand new ones.
Although you might want to consider a slightly cheaper model than the D90 if all you're planning to use it for is pictures of keycaps etc., I think a D40 would suit your needs fine. If you want to do some other photography as well, you can't go wrong with a D90.