GNOME Bugzilla – Bug 781505
Handle currently unhandled RFKILL keys (requires input changes)
Last modified: 2017-05-15 06:59:57 UTC
Bug #760517 will add the ability to disable the kernel handling of rfkill related input events. Unfortunately we don't yet handle enough of the corner cases to actually use this feature in production. To enable, we should at least handle the following two evdev input events: * KEY_WIMAX * KEY_RFKILL Both of these do not have a keysym so adding them is likely only possible on wayland. We are currently in the process of figuring out how to add these as the keycodes will need to be above 255 and are therefore not supported by X11. (That is, KEY_FAVOURITES is being added right now as an example case.) I will update the bug once there is news or upstream bugs available.
The xkeyboard-config bug in question is https://bugs.freedesktop.org/show_bug.cgi?id=100970.
As Hans said in bug #76760517 there are a few more steps involved: https://bugzilla.gnome.org/show_bug.cgi?id=760517#c42 > Ok I've been working on updating various bits and pieces to make KEY_RFKILL work and I can confirm that it works > under X11 too, so once we've all the fixes for KEY_RFKILL upstream we're good to go with this bug. > > I've decided to use a new keysym for the RFKILL key, so that we can differentiate between KEY_WLAN and KEY_RFKILL in the future (if we want to), as a bonus this means no mutter changes are necessary > > This involves several steps: > 1) Get the new keysym define accepted upstream: > https://patchwork.freedesktop.org/patch/155279/ > 2) Sync libkxbcommon with these changes: > https://github.com/jwrdegoede/libxkbcommon/commit/570fcdfd8107f824a398190056436612efa442d1 > 3) Rebuild libX11 against a new xproto package with the added keysyms > 4) Update xkeyboard-config with mappings for the new keysyms (patch to be written) > 5) Update g-s-d with XF86Rfkill keybinding: > https://github.com/jwrdegoede/gnome-settings-daemon/commit/5df52e6c6d6bfc132141879d1485840dc77608c8 > With all the other steps depending on 1. as that finalizes the keysym name. I've commit rights for xproto, so as soon as I've an ack I'll push 1. and start working on the other bits.
> Ok I've been working on updating various bits and pieces to make KEY_RFKILL > work and I can confirm that it works under X11 too, so once we've all the > fixes for KEY_RFKILL upstream we're good to go with this bug. > > I've decided to use a new keysym for the RFKILL key, so that we can > differentiate between KEY_WLAN and KEY_RFKILL in the future (if we want to), > as a bonus this means no mutter changes are necessary > > This involves several steps: > 1) Get the new keysym define accepted upstream: > https://patchwork.freedesktop.org/patch/155279/ > 2) Sync libkxbcommon with these changes: > https://github.com/jwrdegoede/libxkbcommon/commit/ > 570fcdfd8107f824a398190056436612efa442d1 > 3) Rebuild libX11 against a new xproto package with the added keysyms > 4) Update xkeyboard-config with mappings for the new keysyms (patch to be > written) > 5) Update g-s-d with XF86Rfkill keybinding: I've just finished all steps, except for step 5. I'll attach the patch for step 5 here, once that patch is applied this bug can be closed.
Created attachment 351724 [details] [review] [PATCH] media-keys: Add support for new XF86RFKill keysym
Review of attachment 351724 [details] [review]: I think it would be sane to also bind XF86WWAN at the same time (g-s-d will also disable WWAN modules through Network Manager when in airplane mode).
Hi, (In reply to Benjamin Berg from comment #5) > Review of attachment 351724 [details] [review] [review]: > > I think it would be sane to also bind XF86WWAN at the same time (g-s-d will > also disable WWAN modules through Network Manager when in airplane mode). I don't know of any laptops with a specific WWAN toggle key, but if I had such a laptop I would expect it to behave the same as the bluetooth key, iow only toggle WWAN, that would actually be quite a sensible feature since WWAN often has a datacap and/or per MB cost. Toggling all radios on/off for a WWAN key feels wrong to me. So properly supporting XF86WWAN would require more then adding just a key-binding. Regards, Hans
Review of attachment 351724 [details] [review]: Looks good, please commit to master. Also make sure to update your commit message to mention bug 760517, and the bits necessary for this patch to actually work.
(In reply to Bastien Nocera from comment #7) > Review of attachment 351724 [details] [review] [review]: > > Looks good, please commit to master. > > Also make sure to update your commit message to mention bug 760517, and the > bits necessary for this patch to actually work. I don't have commit rights, I'll attach an updated version with an improved commit message.
Created attachment 351852 [details] [review] [PATCH] media-keys: Add support for new XF86RFKill keysym
Committed to master, thanks!