2

In linux we have X11 which governors keyboard layouts but sadly any changes made there don't affect the system as a whole so in a tty you are left with standard qwerty no matter what your X11 preferences are. Recently I decided to delve into the tty so I needed to configure my layout (neo) there. In the end, I couldn't but I've got these questions to ask you:

Why do we have different files to describe X11 layouts and console layouts? Why de we need different tools to manage those layouts? Why no one seems interested in changing the layouts in the console? Do server administrators only use qwerty?

Thanks a lot!

  • See about loadkeys(1). – John WH Smith Jan 7 '15 at 19:23
  • I can't see how this answers any of the questions – Yordan Grigorov Jan 7 '15 at 20:30
  • And yet it does provide some information (besides, I posted a comment, not an answer). loadkeys is used to set a keyboard layout (among other things). It is independent from any graphical (X11/whatever) context. The man page provides some information about how this tool works. – John WH Smith Jan 7 '15 at 20:51
  • My bad, it really is just a comment. I did read the man page though, thank you! – Yordan Grigorov Jan 8 '15 at 8:22
0

Agreeing that it would be nice if the two sets of configurations were integrated together, there are two reasons why they are different:

  • they evolved separately (and no one has proposed an integrated solution which satisfies the requirements of both), and
  • they have different requirements.

The Linux virtual consoles provide a terminal interface which supports POSIX termios: what you might consider low-level character I/O. That was well-defined by the mid-1980s, with technology from the preceding 10 years. The termios interface is concerned with control characters, a few video highlighting features for a single small font, etc. It does not make a lot of assumptions about the keyboard other than that it can send characters.

X11 came near the end of the 1980s, designed to support graphical I/O. It makes different assumptions than termios, e.g., graphics implies multiple fonts (and the ability to display a wide range of characters). Also (because of the need to handle a mouse or other pointer device), it needs additional methods for handling input.

Unlike the termios interface (using a sequence of characters/bytes), X11 passes information by events which hold a lot of information, and events can be combined in ways not contemplated when termios was devised. Thus, rather than encoding control and shift into a character, an X11 event might pass the control modifier as one event, and a key code as another event. The X11 libraries combine those events.

Though both were existing technology from the outset, X11 (even as X386) was less widely used, and basically came too late by several years to influence the design of termios. That was all done before Linux started. Since there was (and apparently still is) no alternative design which provides a distinct advantage, there's been no change since the mid/late-1990s.

Further reading:

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.