It is one place where we have to live with BeOS legacy decisions, at least until R2.
There are only two sets of codes. Let's make up names for them since the documentation doesn't really do that.
On one side (input) there are "key codes". They number the keys on the keyboard mostly from top left to bottom right (with some keys out of place as they were added later).
On the other side (output) of the keymap, there are "characters". These are unicode characters, except for B_FUNCTION_KEY. B_ENTER, B_BACKSPACE, etc are in this space (they are in fact mapped to the ASCII control characters - also part of Unicode).
B_F1_KEY to B_F12_KEY, and in general all the B_*_KEY constants, are key codes. As a result it is not possible to remap function keys using the keymap.
Key codes are in the range 0 to 127, with 0 to 0x6A actually used and some space left for extra keys (if you are the owner of a keyboard with 24 function keys, for example). They are always mapped to the same physical key.
Characters are... well, characters, and the user can customize their keymap and use anything they want from the whole unicode space.
So, if you are after physical key positions, you use key codes. Otherwise, you use characters from the keymap.