[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How can we change the keyboard layout?



On Wed 21 Feb 2024 at 23:16:41 (+0100), hw wrote:
> On Wed, 2024-02-21 at 12:55 -0600, David Wright wrote:
> > On Tue 13 Feb 2024 at 08:09:40 (+0100), hw wrote:
> > > On Sun, 2024-02-11 at 10:35 -0600, David Wright wrote:
> > > > On Wed 07 Feb 2024 at 06:58:39 (+0100), hw wrote:
> > > > > [...]
> > > I'd use multiple keyboards if I had to do that and just change between
> > > keyboards.
> > 
> > Do it if you like. That's what I have on my computer in the basement:
> > a GB-layout M keyboard and a US-layout Microsoft Pro.
> 
> And is their layout identical?

No: Great Britain, GB, and United States, US.

British keyboards have an extra key left of Z; yes, that Z. It's
engraved with \|. There is also an extra key in the ASDFG… row.
It's left of the Return key, which has a different shape, being
merged with the key above, ie the \| key. Of course, that reduces
the number of keys in the QWERTY… row. Which in turn leads to
displacements of the following symbols:
~, @, #, \, |, ", and allows the addition of two more: ¬ and £.

>  If isn't, do all the keys on both
> keyboards what you expect them to do?

Yes, as engraved. There are a lot of shifted key combinations too,
but on the whole I prefer to use Compose sequences, as I find them
more logical. I got used to using them long before I got my first
PC. Rather than remembering which shifted key types ©, I prefer
typing CapsLock c o (or o c) instead. And I've chosen some of the
more obscure ones for myself, eg CapsLock # d s for 𝄪 and
CapsLock # d b for 𝄫.

> > > > > > My 2014 keyboard appears to identify itself correctly as a K520. My
> > > > > > old IBM M says it's an "AT Translated Set 2 keyboard", which seems
> > > > > > reasonable for a keyboard dating from 1988.
> > > Where does it show up?  Where does the information originate from?
> > > Perhaps the information is merely an assumption some of the involved
> > > the software makes and not something the keyboard tells it.
> > 
> > I get it from xinput, which I assume gets it from udev, as the ID's
> > description string occurs in /lib/udev/hwdb.d/60-keyboard.hwdb.
> 
> Does that mean it doesn't come form the keyboard itself?

The OS sends a code and the keyboard returns some bytes, which the OS
interprets as a description. For a keyboard as old as the IBM, I guess
it would be fairly rudimentary, but perhaps it's more expansive for
modern keyboards. I think the OS can also send programming codes to
some modern keyboards to modify their behaviour.

The properties that udev discovers and deduces can be found in
/run/udev/data/c13\:* (amongst a load of other character devices).
The implications of those properties would be found, presumably,
in the drivers.

[ … ]
> But then, how many manufacturers nowadays make keyboards with 122 keys
> like these terminal keyboards for PCs?  The only one I know of is
> Unicomp, and they have adjusted the keyboard controller to deliver
> substitutes for keys PCs don't know (or usually don't have) in order
> to make the keyobard usable for PCs.

I don't know anything about this keyboard apart from reading that
new ones contain some model of Raspberry, making it easier to reflash
the controller.

> Why would the kernel developers make provisions for keyboards that
> don't exist (for PCs)?

Why would the kernel developers restrict themselves to one architecture?

[ … ]
> You mean wev?  What are trying to decode?

I think F18 is being treated as a Left-shifted F6, except that it
releases the Shift before releasing F6, whereas a typist would
normally release Shift after F6.

> I usually NumLock enabled; if it's ever turned off, it's usually only
> by accidident.
> 
> > > For the backtab key it says:
> > 
> > Looking at 911QQZnUFrL.jpg, I don't know which key that is. But again,
> > NumLock appears to be on.
> 
> It's the key to the left to the Delete key which is below the key
> labeled Dup/Insert.

OK, I actually thought it might be the key left of Dup/Insert because
I didn't know that symbol, whereas the key left of Delete appears to
have the same symbol as the keyboard's Enter key (almost next to it).

It looks as if it sends codes similar to F18, using Control instead
of Shift, but in the same unconventional order.

AFAICT the two keys you pressed happen to be ones that don't react to
NumLock being set.

> > Why would it not be able to send a keycode for F18?
> 
> It's because PCs have no more than 12 function keys.
> 
> Maybe they can have more nowadays, but where do you find a keyboard
> for PCs that has more than 12 "true" function keys?

https://www.flickr.com/photos/triplehaata/albums/72157650296043599/with/15857592493
looks ancient enough not to be USB, but modern enough to have a PS/2 plug.

[ … ]
> > This AiO desktop computer, with a wireless keyboard, obeys FN-F11
> > (engraved ⏻ with PC underneath) happily, and promptly falls asleep.
> 
> Such a Fn key is for laptops; I don't want one on a normal keyboard.

The idea behind this is that you can use the wireless keyboard with
a laptop to 1) improve the typing touch, 2) give you a proper keypad
instead of its being folded into the Qwerty keys, 3) substitute for
a faulty or broken keyboard. The marginal cost of marketing an FN-less
keyboard for you, and another with FN for everyone else, would be
rather wasteful.

> And I was talking about actual keys we should have more of, not yet
> another way (or layer) to modify what the existing keys do. If you
> remember the ZX Spectrum, you may also remember how it was infamous
> for having all kinds of things on every key, and some modifier keys to
> summon all the stuff that was on the keys.  People didn't like it back
> then and probably wouldn't like now even less.

I thought the problem that people complained about was the rubbery
feel to the keys, rather than their engravings.

[ … ]
> So you figured out how to change the keyboard layout with Wayland.

I use X—I'm not really interested in wayland.

> So you can't really configure your keyboards once you use wayland.

Not surprisingly, /I/ can't: I don't know whether others can and do.

> > But I don't always use a US keyboard: I use two or three GB keyboards too.
> 
> Well, a German keyboard is quite different from those.

Yes, but I don't think you're unique in using a German keyboard.

> Well, what would you do if you had two different keyboards connected
> at the same time, one US or GB one, and a German one?  Or you could
> have three, US, GB and DE.

> And without Gnome and KDE?  How do you configure them?

You'd get three IDs in the xinput listing, and set the third to
a German layout. That's with X—I don't have Gnome, KDE or wayland.

> > > How do you disable NumLock completely?  I mean that function, not even
> > > the key.  I want it to be always on unless I change that myself.
> > 
> > I guess you'd just use xmodmap to define the scancode to do nothing.
> 
> There's no xmodmap with Wayland.  I'm not sure if you can do it with
> xmodmap.  I doubt you can.

The web seems to think you use XKB, but also that wayland has a way
to go before this is sorted. But I haven't searched further than the
little snippets that google writes under hits. Presumably you're
more motivated than me to read the links themselves.

> > > For passwords it's outright dumb.  You can't see what you're typing
> > > and you have no way of knowing what keyboard layout is in use.
> > 
> > Perhaps check your layout by typing characters at the login prompt,
> > then rub them all out, and continue with your login.
> 
> There are sometimes situations where that isn't feasible, like BIOS
> paswords or passwords to permit access to encrypted file systems you
> need to enter during boot.  And we shouldn't have issues like that in
> the first place.  Nowadays it's not too much to expect that a computer
> can identify a keyboard and make it so that all the keys do what can
> be expected, without/before any extra configuration.  After all, what
> do we have USB for?

If that's a real problem for you, I would follow the advice that's
generally given about avoiding "funny" keys like @, ", and so on;
only you'd also have to avoid one or two others, like T/Z etc.
(I don't see a role for USB in this.)

> > > > When I type Shift-3 on the IBM, it types £; on the Internet Pro it
> > > > types #, just as indicated on their keycaps. Similarly with ¬ and ~
> > > > on the key to the left of 1, when shifted. [ … ]
> > > 
> > > Is that because you configured it so, or does it happen without extra
> > > configuration?
> > 
> > It's in the script that was mentioned in the footnote, where the
> > Id for the keyboard etc comes from the aforementioned xinput command,
> > which lists all the devices connected.
> 
> Isn't that something that should happen automatically?

I wouldn't expect it on legacy keyboards. As for really modern ones,
I don't know—I don't have any. Even then, you need to allow for some
configuring; eg, many people swap Alt and Ctrl but without changing
the keycaps. I define CapsLock as Compose. And so on.

I guess the perfect world would be one where the keycaps were not
printed on the keys, but electronically generated by the keyboard
itself. And when you held down a shift key, the keycaps would change,
to reflect the new state.

> > [ … ] your keyboard looks like
> > 911QQZnUFrL.jpg, I can tell you that the extra GB key is the one
> > that's unengraved, and it's still left of Z, as I wrote.
> 
> For the pound sign?  If I needed a pound sign, that would be a nice
> place put it via keyd.

No, as mentioned above, the extra key found on a GB keyboard is \|,
and the extra symbols are £ (on Shift-3) and ¬ (on Shift-`).

> > > On my keyboard the keycap is, strangely, blank, and it types < or >
> > 
> > I remember using a keyboard that had such a key, but I can't recall
> > which: it was decades ago. But what was most unusual about that
> > keyboard was the comma and fullstop keys were the same when shifted.
> > (More conventional would have been ; and :, as in some continental
> > layouts.) It was great for typing reference lists in scientific papers.
> 
> Perhaps that was a misconfiguration?  I guess most languages have :
> and ;, and computers do need those keys.

No, you can see it at https://en.wikipedia.org/wiki/File:Lk201.jpg.
We used the GB variant, with #£ over the 3. You can also see there's
a Compose key. I used one of these keyboards, first with a VT220,
then with my VT241, from about the early 1980s until around 1996
when I started using Debian.

As for the rest of the post, I'll condense my reply down to:

> 'social media' is not social [ … ]
> I might even go so
> far as to say that it is [ … ] anti-social,

… which is why I wrote (11 Feb):

 "Those really belong on social media, if anywhere,
  and certainly not on a technical mailing list."

Cheers,
David.


Reply to: