Your thinking is somewhat imprecise thenI do not think that this is related to the keyboard. The different key handling is caused by the 'Setenv NUMLOCKOFF 1' environment variable. if you do not set the NUMLOCKOFF variable, then there are only 2 states: Either the numlock is on or off

Does the type of your keyboard show up in the USB Inspector? How does a KVM show here? Does it display in it's own right or does it display as a keyboard (and then does it display as the right keyboard?).
What alternate machine are you switching between? Does it have any issues with the keyboard detection?