Bug 54171 - Map F20 to new XF86AudioMicMute keysym
Summary: Map F20 to new XF86AudioMicMute keysym
Status: RESOLVED FIXED
Alias: None
Product: xkeyboard-config
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: xkb
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-28 22:18 UTC by James M. Leddy
Modified: 2014-06-12 05:38 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
0001-https-bugs.freedesktop.org-show_bug.cgi-id-54171.patch (851 bytes, patch)
2013-05-13 18:10 UTC, James M. Leddy
Details | Splinter Review
0001-Add-XF86AudioMicMute-mappings.patch (882 bytes, patch)
2013-05-13 18:12 UTC, James M. Leddy
Details | Splinter Review

Description James M. Leddy 2012-08-28 22:18:47 UTC
Unfortunately, udev and the kernel use a keymap that is out of range of X for micmute. We should use a key that X can process. Since there is no F20 key on the thinkpad, which is the only platform I know of that has a micmute key, we can use that.
Comment 1 Sergey V. Udaltsov 2012-08-28 23:54:39 UTC
I guess it would be more correct to fix udev/kernel. Isn't that so?

Currently symbols/inet(evdev) is used for all keyboards, so all of them would use F20 for micmute. I am not very happy about that...
Comment 2 James M. Leddy 2012-08-29 15:51:04 UTC
(In reply to comment #1)
> I guess it would be more correct to fix udev/kernel. Isn't that so?

It's already "fixed" in udev/kernel, because udev/kernel can handle keycodes over 255. However, X11 can't (MICMUTE is out of range), we have to remap it to something that X11 can use. We've used F21-23 before, so I assumed that was the best place to put it. I'm open to suggestions.

> Currently symbols/inet(evdev) is used for all keyboards, so all of them would
> use F20 for micmute. I am not very happy about that...

What keyboards have F20? We're already using F21-23 for the touchpad on/off/toggle buttons, so there is a precedent for this.
Comment 3 Bastien Nocera 2012-08-29 15:55:10 UTC
Are there physical keyboards with an F20 key?
Comment 4 James M. Leddy 2012-08-29 16:02:04 UTC
(In reply to comment #3)
 
Not in common use. The M keyboard only has 12, and the Sun keyboard only has 12. Seems that every PC vendor and certainly every laptop maker only goes up to F12. Even the X Termainal photo from Wikipedia only has up to F12
Comment 5 Alan Coopersmith 2012-08-29 16:47:29 UTC
(In reply to comment #4)
> Not in common use. The M keyboard only has 12, and the Sun keyboard only has
> 12. Seems that every PC vendor and certainly every laptop maker only goes up to
> F12. Even the X Termainal photo from Wikipedia only has up to F12

Sun keyboards in the 80's had 35 F-keys - since around 1990 many of those were
relabeled - the left side keys to the SunStop, SunProps, etc and the right side
to the numeric keypad.   Those were only found on the old Sun 4 and older
systems, not any UltraSPARC, x86 or AMD64 systems.   I think other Unix
workstations from the era had similarly large amounts of F keys for the
CAD/CAM applications of the time, but those fell out of use over the years.
Comment 6 Andreas Wettstein 2012-08-29 18:49:05 UTC
> Are there physical keyboards with an F20 key?

Unicomp "terminal" keyboards have 24 function keys, are still manufactured, and available with USB for use with a PC.
Comment 7 Sergey V. Udaltsov 2012-08-29 21:13:15 UTC
> Unicomp "terminal" keyboards have 24 function keys, are still manufactured, and
> available with USB for use with a PC.
So, F30?
Comment 8 James Cloos 2012-08-30 14:30:31 UTC
I wasn’t ready to come out of the woodwork with this, but given this bug
report....

I've started implementing my earlier suggestion to get around X’s 8–bit
keycode limitation by modifying evdev to create one X keyboard device
for each 7–bit block of linux event key codes.

This will make every key available to X, inlcuding the mic mute key,
the zoom key (Fn-SPC), et al.

Not to mention all of the telephone and media-device input keys
(KEY_OK .. KEY_CAMERA_RIGHT).

My plan was/is to get it into shape by the end of this (holiday)
weekend.
Comment 9 James M. Leddy 2012-08-30 16:00:36 UTC
Wow, okay. That's great news! I can certainly wait a few more months, thanks for working on it.
Comment 10 James M. Leddy 2012-08-30 16:01:01 UTC
s/months/days/
Comment 11 James M. Leddy 2012-10-30 10:44:32 UTC
Hi James,

I don't think I'm on the relevant mailing lists. Have you posted the code yet?
Comment 12 Ozan Çağlayan 2013-03-19 10:44:01 UTC
What's the status of this?
Comment 13 James M. Leddy 2013-03-19 13:51:42 UTC
The bug is stagnant. I'm not sure if James Cloos has fixed it in X yet, but because we're waiting on that proper fix we haven't mapped micmute to F20 just yet.
Comment 14 James M. Leddy 2013-04-17 20:38:56 UTC
I've sent another message to the list to see if they would include the patch. It is not worth holding off on this, even if we do eventually get around the 8 bit keycode limitation, since while I wasn't looking both udev and gnome-settings-daemon have standardized on F20 for this key.

https://git.gnome.org/browse/gnome-settings-daemon/commit/?id=5cda26ee
Comment 15 Sergey V. Udaltsov 2013-04-18 21:27:12 UTC
I would prefer for James Cloos to fix it properly..
Comment 16 James M. Leddy 2013-04-18 22:52:58 UTC
(In reply to comment #1)
> Currently symbols/inet(evdev) is used for all keyboards, so all of them
> would use F20 for micmute. I am not very happy about that...

This doesn't really make sense. Yes, today symbols/inet is used for all keyboards, but FK20 (code 198) is not mapped to _anything_. If you actually have a keyboard with an F20 key, it'll be remapped by the vendor specific keyboard map anyway (eg digital_vndr/lk).

A quick grep reveals that only 3 keyboards even use this key: a VT105, an ancient DEC keyboard that also requires a special driver, and a fujitsu keyboard that I can't find any mention of online. 

The other approach if people are really big on keeping F20 functionality around is to map FK20 to F20, and leave gnome-settings-daemon as it is. This has the downside of making XF86AudioMicMute irrelevent.
Comment 17 Peter Hutterer 2013-04-19 01:13:20 UTC
quite frankly, I think we should admit defeat and go with the F20 route. X gaining support for > 255 keycodes is unlikely to ever happen and F20 is as good/bad a key as any.
Comment 18 James Cloos 2013-04-19 15:01:54 UTC
Anthough I know what needs to be done, and have a preliminary commit for
xkeyboard-config, the changes for xf86-input-evdev will require a block
of time I've not been able to schedule.

I agree that that f20 patch is good for now.

I'll post something on the list about my proposed patches.
Comment 19 Sergey V. Udaltsov 2013-04-19 22:03:37 UTC
Ok, let's do it with F20. The patch does not apply to git:

$ git am ~/Downloads/mail.google.com
Applying: Add XF86AudioMicMute mappings
error: patch failed: symbols/inet:120
error: symbols/inet: patch does not apply
Patch failed at 0001 Add XF86AudioMicMute mappings
The copy of the patch that failed is found in:
   /home/svu/git/xkeyboard-config/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Comment 20 James M. Leddy 2013-05-13 18:10:41 UTC
Created attachment 79265 [details] [review]
0001-https-bugs.freedesktop.org-show_bug.cgi-id-54171.patch

Sorry about that, this patch should work.
Comment 21 James M. Leddy 2013-05-13 18:12:52 UTC
Created attachment 79266 [details] [review]
0001-Add-XF86AudioMicMute-mappings.patch

Forgot the title for the last patch. This one is better.
Comment 22 Sergey V. Udaltsov 2013-05-14 19:55:22 UTC
applied, thanks!
Comment 23 Martin Pitt 2014-06-11 07:54:17 UTC
Current kernels have KEY_MICMUTE==248, i. e. X.org should be perfectly able to recognize this. Apparently this was done in 2011 already.

Can we update xkeyboard-config to also recognize KEY_MICMUTE in addition to F20, so that it works with both kinds of udev/kernel keymaps for a while? After that version has been out in the wild for some time, we can mass-convert the udev keymaps to produce the proper KEY_MICMUTE instead of KEY_F20.
Comment 24 Bastien Nocera 2014-06-11 08:39:05 UTC
(In reply to comment #23)
> Current kernels have KEY_MICMUTE==248, i. e. X.org should be perfectly able
> to recognize this.

I'm not certain that's enough for X.org to be able to handle it. Any changes to this should go in another bug anyway.
Comment 25 James Cloos 2014-06-11 09:48:19 UTC
> Current kernels have KEY_MICMUTE==248, i. e. X.org should be
> perfectly able to recognize this. Apparently this was done in
> 2011 already.

248 is the first linux kernel value which X cannot handle.

The mapping is +8, so 248 ⟹ 256, which does not fix in 8 bits.

(The first 8 are reserved – from way back – for the modifiers.)
Comment 26 Bastien Nocera 2014-06-11 10:06:06 UTC
(In reply to comment #25)
> > Current kernels have KEY_MICMUTE==248, i. e. X.org should be
> > perfectly able to recognize this. Apparently this was done in
> > 2011 already.
> 
> 248 is the first linux kernel value which X cannot handle.
> 
> The mapping is +8, so 248 ⟹ 256, which does not fix in 8 bits.
> 
> (The first 8 are reserved – from way back – for the modifiers.)

So nothing to change until we're all using Wayland.
Comment 27 Martin Pitt 2014-06-12 05:38:08 UTC
Ah, thanks for the heads-up!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.