If you look at how Apple do it with wireless keyboards, they ask you to press the key immediately to the left of another key, and then maybe the key to the right of a different key. With a couple of presses you can work out a lot of information, that would help you know what sort of keyboard layout it is.