Anybody know if it's possible to query a keyboard directly to learn its layout? I believe it isn't, but a cow-orker asked because he wants to diddle the X modmap in various internationalization-dependent (i18n !) ways based on which type of keyboard is attached, without consulting a config file and without asking the user.