1

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?

1 Answer 1

1

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

NAME
   xkbprint - print an XKB keyboard description

SYNOPSIS
   xkbprint [options] source [ output_file ]

DESCRIPTION
   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.

3
  • 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. May 5, 2015 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? May 6, 2015 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. May 7, 2015 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .