Well, considering inputkey is a local variable, it'll only have relevance in this procedure. If this data is required elsewhere you'll need to either change the procedure to a function that returns an integer and make sure you set result := inputkey, or make inputkey a global variable.

Also keep in mind GetKeyboardState returns the state of the keyboard at the time the function was called (this includes all keys that are being pressed). So if VK_NUMPAD1 and VK_NUMPAD9 are simultaniously being pressed, the code above will set inputkey to be 9. Keys which you want to give a higher presidence to should always be lower on the list.

If you wish to avoid this entirely, and don't plan to actually handle the keys in this procedure, but rather are just gathering data and will handle these keys at a later time you might want to make inputkey a word rather than an integer and map each key to a bit.

ex.
inputkey: word;

0000000000000001 = NUMPAD1 = 1
0000000000000010 = NUMPAD2 = 2
0000000000000100 = NUMPAD3 = 4
0000000000001000 = NUMPAD4 = 8
0000000000010000 = NUMPAD5 = 16
0000000000100000 = NUMPAD6 = 32
0000000001000000 = NUMPAD7 = 64
0000000010000000 = NUMPAD8 = 128
0000000100000000 = NUMPAD9 = 256

then when you set each inputkey you just OR the proper value so if VK_NUMPAD1 and VK_NUMPAD9 being simultaniously being pressed:

inputkey := inputkey OR 1;
inputkey := inputkey OR 256;

and inputkey would be equal to 0000000100000001 (257 decimal). Then elsewhere in your code you could use the same method of ANDing we used originally (using these new inputkey specific values, not virutal keycodes), to findout what keys of inputkey are being pressed.

if ((inputkey and "decimal value goes here") <> 0) then begin
end;

Hope that all makes sense. If not just let me know, I'll try to clear it up a little.