I don't think you can, and d�pending on the type of keyboard, unexpected result could happen, for exemple:
for the '2' key, a qwerty keyboard will return 2 without Caps, and with caps, but in azerty, it'll return � without caps, and 2 with caps, so I am not sure you can do it easily