It distinguishes between the numbers and the numpad; it simply has been coded to return the same values for us, making it seem as it it hasn't.
For the number keys above the alphabet:
DATA 48,48,0,41,0,0,0.2: '0
DATA 49,49,0,33,0,0,0.2: '1
DATA 50,50,0,64,0,0,0.2: '2
' Index Unmodified Ctrl Shift Alt AltGr Repeat
DATA 51,51,0,35,0,0,0.2: '3
DATA 52,52,0,36,0,0,0.2: '4
DATA 53,53,0,37,0,0,0.2: '5
DATA 54,54,0,94,0,0,0.2: '6
DATA 55,55,0,38,0,0,0.2: '7
DATA 56,56,0,42,0,0,0.2: '8
DATA 57,57,0,40,0,0,0.2: '9
And for the numpad:
DATA 96,48,0,0,0,0,0.2: 'Numpad 0
DATA 97,49,0,0,0,0,0.2: 'Numpad 1
DATA 98,50,0,0,0,0,0.2: 'Numpad 2
DATA 99,51,0,0,0,0,0.2: 'Numpad 3
DATA 100,52,0,0,0,0,0.2: 'Numpad 4
' Index Unmodified Ctrl Shift Alt AltGr Repeat
DATA 101,53,0,0,0,0,0.2: 'Numpad 5
DATA 102,54,0,0,0,0,0.2: 'Numpad 6
DATA 103,55,0,0,0,0,0.2: 'Numpad 7
DATA 104,56,0,0,0,0,0.2: 'Numpad 8
DATA 105,57,0,0,0,0,0.2: 'Numpad 9
DATA 106,42,0,0,0,0,0.2: 'Numpad *
DATA 107,43,0,0,0,0,0.2: 'Numpad +
DATA 108,900108,0,0,0,0,0.2: 'VK_SEPARATOR
DATA 109,51,0,0,0,0,0.2: 'Numpad -
DATA 110,52,0,0,0,0,0.2: 'Numpad .
DATA 111,53,0,0,0,0,0.2: 'Numpad /
Let's compare the two values 3, for example:
DATA 51,51,0,35,0,0,0.2: '3
DATA 99,51,0,0,0,0,0.2: 'Numpad 3
The Red values above represent the internal key which Windows designates for the physical key on our keyboard.
The Blue values are the ASCII values which we return when we press that key. They're different physical keys, but we've mapped them both to return the same values for us.
I suppose I should probably write a small helper routine for us though, so one can tell which of the physical keys is being pressed, just in case they wanted to be able to distinguish between the two of them -- though that would actually be just as simple as check with the physical value.
IF keys(51).down then 'It's the number 3, above the letter keys
IF keys(99).down then 'It's the numpad 3