The keyboard is not the biggest determinant. I am typing on an absolutely mammoth Model F 122-key terminal right now, and the peak of the uppermost key is perhaps 2 Imperial inches above the tabletop (that is 5 cm to non-Americans) and my wife's svelte Apple Aluminum (with a little built-in leg-like protrusion at the back) is about 3/4" or 2 cm maximum.
90% of the other keyboards in the world probably split that difference about halfway, and so the usual variation between boards is probably not more than single centimeters. (I never use the legs, although that would give me even more reason to use a wrist rest.)
Desk heights are pretty standard, meant to rest elbows on, so dropping the keyboard tray 2"-3"-4" is probably a good idea for most people. But being a big guy, I can't stand keyboard trays because they interfere with my leg room. My wife depends on them. Also, my chair has more height adjustment than that. For a keyboard tray to be comfortable to me, I would have to raise the desk a couple of inches.
I gauge the wrist rest height to the height of the spacebar, because I am looking for it do just that, provide a rest for my wrist.