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

Re: How can we change the keyboard layout?



On Sun, 2024-02-11 at 10:35 -0600, David Wright wrote:
> On Wed 07 Feb 2024 at 06:58:39 (+0100), hw wrote:
> > [...]
> > > It's also obvious that "change the keyboard layout" is ambiguous,
> > > and you didn't intend to mean switching between two layouts.
> > 
> > It's not at all obvious, and it's not really ambiguous.  Changing the
> > keyboard layout has always been about changing the keybaord layout and
> > never about switching between different keyboards or between different
> > layouts.  That only came up much later when such a feature was added
> > to some so-called desktop environments, and it's a very short sighted
> > feature since it omits a way of changing they keyboard layouts, which
> > is a far more important feature.
> 
> It seems quite important when you're used to typing in more than
> one language, and want your layout to match what you're used to.

Sure it is, and when you do that, it's even more important to be able
to change the layout because you have to do it for all the languages
you're used to typing in --- and for all the keyboards you're using.
I'd use multiple keyboards if I had to do that and just change between
keyboards.

I don't know if that's possible, but I expect it to be possible since
USB makes it easily possible to have multiple keyboards connected at
the same time.  So like in gnome settings, all the connected keyboards
need to show up so that I can pick a layout for each and then change
their layouts as I need them.  If that doesn't work it's a bug.

Actually, I just tried it and it doesn't work :(  The German keyboard
gets an US layout just like the US keyboard; it doesn't show up in
gnome settings, and there is no way to select a keyboard and to pick a
layout for it.  That really sucks --- I can only assume that
developers don't want to have to do anything with keyboard layouts,
which might explain why it has always been a nightmare to get a
keyboard to work right and still is.

> > > > [...]
> > > 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.
> > 
> > I can see USB keyboards identifying themselves, but keyboards with
> > PS/2 or DIN connectors?  How does your keyboard from 1988 connect?
> 
> PS/2. IIRC it came with a genuine IBM PS/2 computer.

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.

> > > In 26 years, the number of keys has increased considerably, from 102
> > > to 107, plus six audiovisual buttons. Two of the extra keys are
> > > shifting ones (win and fn).
> > 
> > 10% more keys isn't considerably more.  Can you show me a keyboard
> > with 122 keys that has all keys usable and unique rather than sending
> > key combinations instead?
> 
> That would be difficult:

That's what I've been saying :)  Years ago I read an article about
keyboards and it said that due to hardware restrictions, only so many
keys can be handled so that keyboards with 122 keys don't really work:
Either the controller in the keyboard key combinations, or the keys do
nothing.  Apparently such keyboards seem to come from terminals that
could use all the keys while PC hardware can not.

About 20 years ago I've seen a machine with terminals running some HP
Unix that had keyboards like that.  They were networked through token
ring coax cables and had been used to run some CAD software which had
been replaced with, IIRC, autocad, but there were still files people
sometimes needed to retrieve from them, via NFS IIRC.  They were nice
keyboards and had connectors that wouldn't fit any PC.

> I've never had a 122 key keyboard, or even seen one. You have
> one. In terms of xev output, are there duplicate keys? Which ones,
> and how does xev identify them?

I don't know if there are duplicate keys.  I didn't try out all the
key to find any, and I haven't noticed any.

When I press F18, for example, wev says:

,----
| [11:  wl_data_device] selection: id: 4278190081
| [13:      wl_pointer] motion: time: 665008611; x, y: 617.781250, 467.316406
| [13:      wl_pointer] frame
| [14:     wl_keyboard] key: serial: 270273; time: 665012185; key: 50; state: 1 (pressed)
|                       sym: Shift_L      (65505), utf8: ''
| [14:     wl_keyboard] modifiers: serial: 270274; group: 0
|                       depressed: 00000001: Shift 
|                       latched: 00000000
|                       locked: 00000010: Mod2 
| [14:     wl_keyboard] key: serial: 270275; time: 665012185; key: 72; state: 1 (pressed)
|                       sym: F6           (65475), utf8: ''
| [14:     wl_keyboard] key: serial: 270276; time: 665012313; key: 50; state: 0 (released)
|                       sym: Shift_L      (65505), utf8: ''
| [14:     wl_keyboard] modifiers: serial: 270277; group: 0
|                       depressed: 00000000
|                       latched: 00000000
|                       locked: 00000010: Mod2 
| [14:     wl_keyboard] key: serial: 270278; time: 665012313; key: 72; state: 0 (released)
|                       sym: F6           (65475), utf8: ''
`----

For the backtab key it says:

,----
| [14:     wl_keyboard] modifiers: serial: 270525; group: 0
|                       depressed: 00000004: Control 
|                       latched: 00000000
|                       locked: 00000010: Mod2 
| [14:     wl_keyboard] key: serial: 270526; time: 665107706; key: 72; state: 1 (pressed)
|                       sym: F6           (65475), utf8: ''
| [14:     wl_keyboard] key: serial: 270527; time: 665107834; key: 37; state: 0 (released)
|                       sym: Control_L    (65507), utf8: ''
| [14:     wl_keyboard] modifiers: serial: 270528; group: 0
|                       depressed: 00000000
|                       latched: 00000000
|                       locked: 00000010: Mod2 
| [14:     wl_keyboard] key: serial: 270529; time: 665107834; key: 72; state: 0 (released)
|                       sym: F6           (65475), utf8: ''
`----

These keys don't exist on PCs, so the keyboards converts them.  IIRC,
Unicomp used to have a version that was suited for terminals like IBM
made them, i. e. with all 122 keys working and not converted.

> The keyboards I have access to all send usable keycodes, even where
> the engravings are the same, eg, Return/36 and KP_Enter/104 are both
> engraved with "Enter", KP_Subtract/82 and minus/20 are both engraved
> with "-".

I get usable keycodes, too.  It looks pretty much like this, only the
symbols on the two keys in the bottom row on the very left look nicer
on mine: https://m.media-amazon.com/images/I/911QQZnUFrL.jpg

> The only key on this K520 that doesn't send a keycode on its own is
> the gold FN key, which behaves more like a laptop's Fn key, sending
> "control functions" like Sleep; plus a battery charge indicator.

I guess that's useful for laptops --- and one example of how it's
great to have more keys.  Why is there still no 'Hibernate' key on
every keyboard?  That's not only useful laptops ...  I could use like
F20 for it if I could configure that, but unfortunately, my
workstation doesn't really hibernate, so I haven't tried.

> > > > We're still trying to figure out keyboards manually.  Instead of
> > > > improvements, we now have come so far that we even can't do that at
> > > > all now.
> > > 
> > > I'm guessing that criticism is specific to wayland.
> > 
> > No, it's about keyboards and computers.
> 
> Well excuse me. You did say earlier that you were talking about
> wayland all the time. Now, without indication, you're talking about
> all keyboards and computers. How are we meant to keep up?

By reading, applying your intelligence and by understanding?

I was particularly interested in changing the keyboard layout for
wayland because that was an unsolved problem.  That doesn't mean that
the things I pointed out are specific to wayland.  Perhaps that's not
obvious when you're always using an US keyboard and never feel a need
to change the layout.  Like I said before, all the developers must be
Americans which may explain how keyboard configuration is still such a
big problem.

Just see the example above with multiple keyboards connected at the
same time.  If my desk were larger, it would make sense for me to have
both a German and an US keyboard connected at the same time, each with
their own layout.  So how the hell would you do that with Gnome?  How
user friendly is this --- wayland or not.  Why doesn't my computer
just detect the keyboards automatically and automatically picks a
suitable layout for each by default which I can then change?  We have
2024 now, not 1984 ...

It's silly that we can pick a keyboard layout for every freaking
window, but we can have only one keyboard (which isn't even detected
automatically)!  That doesn't make any sense.

> As for figuring out keyboards, I would say that Xorg does a pretty
> flexible job. There are plenty of preselected options available in
> /usr/share/X11/xkb/rules/base.lst, and I guess you can override
> all you like with /etc/X11/xkb/ to get whatever you like. Not that
> I've needed to do so, as the options provided work here AFAICT.

Well, where's my nice GUI thingy that would let me change the keyboard
layout?  Why do I have to configure the keyboard for the console
extra, and why is not even the state of the NumLock key consistent
between Xorg/Wayland and console?  That's sooo annoying when you type
a number and something else happens instead just because that suddenly
changed.

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.

No, it doesn't do a good job at all --- maybe a flexible one, but not
a good one.

> > Can you show me a keyboard
> > that you can plug in and have working with the correct keyboard layout
> > so that every key does what it is supposed to do without any
> > configuration required?
> 
> No, not without /any/ configuration. I'm guessing that you mean an
> EDID-like PROM that completely describes the layout of every key.
> I don't know that keyboard manufacturers have ever looked at
> something like that, at least for detached keyboards.

see

> But even then, it's likely that some configuration would be necessary
> as people exercise their own preferences over at least such things as
> CapsLock's behaviour and placement. If such advances led to an
> inability to tweak the layout, I'd see that as a backward step.

Yes, of course we need to be able to change the keyboard layout after
the keyboard was detected and configured correctly.  That doesn't mean
it shouldn't be detected and configured correctly at all.

Do you have any idea how 'nice' it is when you have to make BIOS
settings or the like with a German keyboard and you need to enter
characters like - or = or |?  I don't have much of a problem with that
because I know where they are on the US keyboard I'm using all the
time (but I still need to experiment).  But most people don't.  Most
people speak Chinese or Spanish ...  So why aren't their keyboards
configured correctly to begin with once plugged in?  How backwards is
that.

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.

> I don't use Gnome. I have /e/d/keyboard set up so that I can switch
> layouts, but I actually set them automatically in .xsession,¹ in
> the same way as I configure mice buttons and motions, trackpad
> tapping/scrolling behaviour, and so on. Each device is configured
> individually.

Each keyboard, too?

> 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. The extra key that GB
> keyboards have, \|, is left of Z, and the position of one other key
> is moved, allowing for a tall Return key instead of a wide one.

Is that because you configured it so, or does it happen without extra
configuration?

The key left of Z is usually T.  See what I mean?

On my keyboard the keycap is, strangely, blank, and it types < or >
--- and with Ctrl, it does nothing, but with Alt, in Emacs runs
beginning-of-buffer (M-<).  For me, that's an extra key I could use
for something else since < and > are on , and ..  I guess I could swap
the keycap from another keyboard in.

> > [...]
> > About Xorg being no longer maintained or about Fedora dropping it?
> > What are those references?
> > 
> > I've only found that apparently one person wanted to see some features
> > in Xorg and decided to work on it after it was declared abandoned and
> > that it is still on the way out.  It seems it's only a matter of time.
> 
> You were asking me to refute something that Fedora is alleged to have
> said, without actually showing anywhere that they said it.

You can use a search engine as well as I can.  For example:

https://blog.nicco.love/gnome-is-gradually-dropping-x11/
https://pagure.io/fedora-workstation/issue/395

> And you backup your claim with a suggestion that there's only one
> person who doesn't want it abandoned? Please show a reference to
> where they say they're planning to abandon it.

That's not what I said.

https://www.theregister.com/2020/10/30/x_server_lead_maintainer_declares/

Someone picked it up later and I'm too lazy to find that page again.
Thomas Adams also said on the fvwm mailing list that he wants to help
keeping Xorg alive because he wants to keep fvwm alive.

> > > > I'm sure others will follow.  It's only that an up to it's date Debian
> > > > is already outdated so badly that you can't even get an AMD graphics
> > > > card to work which was released a year ago.  Maybe that's why Debian
> > > > users haven't noticed yet.
> > > > 
> > > > Already 20 years ago Debian was so outdated that I had to run testing
> > > > even on servers, and that's one of the reasons why I'm very reluctant
> > > > to use it for servers now.  Unfortunately, that leaves no good
> > > > alternative for servers.
> > > 
> > > I can't make heads or tails of this. I don't know whether you have
> > > some unique problems with running Debian: you certainly seem to have
> > > an awful lot of them.
> > 
> > I've described my experience and I can't help it when you can't
> > understand what I'm saying and draw conclusions out of what you don't
> > understand.
> 
> Those paragraphs didn't describe your experience: the first just
> insulted Debian users;

There's no insult here.  It's a matter of fact.  You can dig through
the mails on this list for the issue if you want.  I asked here how I
could get the card to work and there were suggestions like using
special kernels from testing or something like that, and I decided to
install Fedora instead because I didn't want to deal with Debian
problems that existed then and may have continued to exist.

Check the packages in Debian and the versions of the software they
contain and verify them to the current versions of the software, and
the changes between the versions, if you want a complete picture.
Sometimes it's advantageous to have old software, like asterisk which,
unfortunately, dropped xmpp support quite a while ago and Debian (11,
I think) still has it.  Sometimes it is a disadvantage, and my
experience is that it's generally more a disadvantage.

I don't see why or how facts would insult anyone.

> the second had no facts, just opinions.

Experience is not opinion.

> And your reply is just one of those insults that you occasionally
> toss out here. Those really belong on social media, if anywhere,
> and certainly not on a technical mailing list.

I'm not insulting anyone.  If I did insult someone, I'd have reason
to, and that someone would probably know.

Of course you may feel insulted by facts and/or experience, but don't
blame me for it.

Besides, there is no such thing as 'social media'; what you're
referring to is commercial media, and I don't have anything to do with
that.


Reply to: