After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777000 - Add an option to set the keyboard model
Add an option to set the keyboard model
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-01-08 09:59 UTC by al
Modified: 2021-07-05 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Chromebook keyboard (4.33 KB, application/x-shellscript)
2018-01-04 23:28 UTC, jeremy9856
Details

Description al 2017-01-08 09:59:13 UTC
When using some keyboards (like the Chromebook keyboards), setting the XKB model is needed for them to work as expected (in this case, so the keys in the function key row work as modifier keys. When using Xorg it is possible to set the model manually by using:

setxkbmap -model chromebook

However, this does not work when using Gnome on Wayland, since input sources are handled directly by the desktop compositor. This could ideally be set at least via an option on org.gnome.desktop.input-sources in dconf.
Comment 1 Jonas Ådahl 2017-01-09 03:34:17 UTC
I think this should rather be fixed properly for everyone. Optimally, we should do it in the same way as we handle special XKB layouts/variants (used by devices such as the YubiKey) by adding a XKB_FIXED_MODEL to the hwdb. This way we mark each device that needs a special xkb model and it'll work for everyone without any need to tweak any knob.

I made a systemd branch here that introduces the udev tag: https://github.com/jadahl/systemd/commits/wip/xkb-fixed-model
Comment 2 Peter Hutterer 2017-01-09 04:16:19 UTC
ACK, this seems like the most effective solution.
Comment 3 Bastien Nocera 2017-01-09 11:10:25 UTC
See: https://bugzilla.gnome.org/show_bug.cgi?id=650772
Comment 4 Jonas Ådahl 2017-01-11 05:38:08 UTC
(In reply to Bastien Nocera from comment #3)
> See: https://bugzilla.gnome.org/show_bug.cgi?id=650772

Could you summarize? Whats the conclusion? The intended solution will not introduce any UI or preferences, it'd be a udev property set according to the hwdb that mutter would try to honor. See bug 775681 for a similar thing we need to do.
Comment 5 Jonas Ådahl 2017-01-16 13:18:57 UTC
al, in order to get the device you have that needs the "chromebook" xkb model match a potential udev hwdb rule, could you run "evemu-describe" to get the given keyboard device details?
Comment 6 al 2017-01-17 17:29:03 UTC
The DMI identificator of the keyboard in my device as shown by evemu-describe is:

DMI: dmi:bvncoreboot:bvr4.0-6588-g4acd8ea-dirty:bd09/04/2014:svnGOOGLE:pnPeppy:pvr1.0:rvnGOOGLE:rnPeppy:rvr1.0:cvnGOOGLE:ct3:cvr:

This hwdb rule correctly matches my keyboard:
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnGOOGLE:pnPeppy:pvr*

This is an Acer C720 Chromebook (codename Peppy), btw.
Comment 7 jeremy9856 2018-01-04 23:07:20 UTC
I have the same problem with my Chromebook. AFAIK, unlike other desktop environnement, there is no way to change the keyboard model with Gnome Shell. It's not really a problem with X11 since there is multiple ways to change the keyboard model. I use this method "$ sudo localectl set-x11-keymap fr chromebook".

But in Gnome Shell with wayland, since all the X11 tools doesn't work anymore, it's impossible to change the keyboard model.

Is there a workaround ? Can you add a way to change the keyboard model ?

Thanks.
Comment 8 jeremy9856 2018-01-04 23:28:34 UTC
Created attachment 366339 [details]
Chromebook keyboard

By the way, we need to select a custom keyboard model because there is some missing key on the Chromebook keyboards. We "unlock" them with an overlay key.

Here is mine and here is the more official one that come with crouton https://github.com/dnschneid/crouton/blob/master/targets/keyboard

Here is more explanation
https://github.com/dnschneid/crouton/wiki/Keyboard
Comment 9 jeremy9856 2018-01-04 23:30:31 UTC
If that can be add to a udev hwdb rule it could be nice too I guess.
Comment 10 jeremy9856 2018-01-04 23:34:36 UTC
Sorry for the multiple comments but that make me think that I use a udev hwdb rule in complement for my Chromebook :

# tee "/etc/udev/hwdb.d/90-chromebook-keyboard-fix.hwdb" << 'EOF'
# Chromebook 14 fix
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:pvr*
 KEYBOARD_KEY_db=leftmeta
EOF
# udevadm hwdb --update
Comment 11 jeremy9856 2018-01-06 11:52:13 UTC
Well, after some research, a udev hwdb rule, afaik, is not the solution. hwdb can't handle the 'overlay" keys to add the missing keys like "overlay key (Right Ctrl)" + "backspace" = "delete". So we really need that gnome allow us to choose the keyboard model like other desktop environment and display manager do (xfce, kde, sway, etc...). Thanks.
Comment 12 Peter Hutterer 2018-01-07 21:52:24 UTC
the hwdb is a merely descriptive database that can add udev properties. Actual functionality changes depend on external bits that read those properties (the udev-builtin-keyboard for KEYBOARD_KEY_* for example). The proposal in comment #1 is to add such a merely descriptive property but then have mutter read it and apply the model correctly based on that. This is more work initially (and where your focus should be if you want to help out) but long-term makes things work out-of-the-box for everyone.
Comment 13 jeremy9856 2018-01-07 22:14:20 UTC
Does the proposal in comment #1 can handle the "latch" keys needed to emulate the missing keys ? If that's the case how can we help ?
Comment 14 Bastien Nocera 2018-01-08 05:40:03 UTC
(In reply to Jonas Ådahl from comment #4)
> (In reply to Bastien Nocera from comment #3)
> > See: https://bugzilla.gnome.org/show_bug.cgi?id=650772
> 
> Could you summarize? Whats the conclusion? The intended solution will not
> introduce any UI or preferences, it'd be a udev property set according to
> the hwdb that mutter would try to honor. See bug 775681 for a similar thing
> we need to do.

The conclusion is exactly that :)

udev/hwdb property to tag devices that need specific models, and mutter to apply those properties.
Comment 15 jeremy9856 2018-01-18 12:48:52 UTC
(In reply to Peter Hutterer from comment #12)
> the hwdb is a merely descriptive database that can add udev properties.
> Actual functionality changes depend on external bits that read those
> properties (the udev-builtin-keyboard for KEYBOARD_KEY_* for example). The
> proposal in comment #1 is to add such a merely descriptive property but then
> have mutter read it and apply the model correctly based on that. This is
> more work initially (and where your focus should be if you want to help out)
> but long-term makes things work out-of-the-box for everyone.

Peter can you tell me if the proposal in comment #1 can handle the "latch" key needed to emulate the missing keys (like "overlay key (Right Ctrl)" + "backspace" = "delete") ?
Comment 16 Peter Hutterer 2018-01-19 06:27:36 UTC
if the current XKB model supports what you need, then that proposal supports it too. If it doesn't, then not :) It's literally no different to adding a xkb model, except that it'll be a fixed database of devices rather than a config option.
Comment 17 jeremy9856 2018-01-19 09:37:56 UTC
Well I guess that should work. Do you know when we will be able to test it ?
Comment 18 Peter Hutterer 2018-01-22 01:00:41 UTC
Somebody needs to write the code first, and it's unfortunately ETIME for a lot of people
Comment 19 GNOME Infrastructure Team 2021-07-05 13:46:01 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.