I would like to make a web page where the user chooses a language, and depending on the language, show a keyboard with all characters corresponding to that keyboard.

I've been told that Unix has everything already done for that.

Where should I look to find out all keyboards, with mappings, that my Linux supports?

I would like to create a Webpage that displays something like this:

Keyboard layout

What is the utility which could hep me to generate this?


Assuming this is for an X environment, xkbprint looks like what you're looking for:

   xkbprint - print an XKB keyboard description

   xkbprint [options] source [ output_file ]

   The  xkbprint  command generates a printable or encapsulated PostScript
   description of the XKB keyboard description specified by  source.   The
   source  can be any compiled keymap (.xkm) file that includes a geometry
   description or an X display specification.

If you want to show it on the user's X display, then you'll also need to look at a PostScript viewer, such as gs.

  • I re-read the question, and you want it as a 'web page' - so you'll want gs to write a PNG or something. Also easily done. – Toby Speight May 5 '15 at 15:48
  • I want to have a keyboard with all 4 possible combinations that are in the configuration files of the /usr/share/X11/xkb/symbols/ directory. Using xkbprint like explained here askubuntu.com/questions/380052/how-to-use-xkbprint only prints keys and shift keys, never altgr combination keys. Any idea how to do it? – Olivier Pons May 6 '15 at 21:39
  • Did you use -nkg 2 option to xkbprint to make include more than one group shift? I'm not sure whether altgr is a group shift in your layout, so it might not work for you. – Toby Speight May 7 '15 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.