From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Pane0-0002Pl-MV for garchives@archives.gentoo.org; Thu, 06 Jan 2011 11:04:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3721FE070D for ; Thu, 6 Jan 2011 11:04:35 +0000 (UTC) Received: from smtp1.madeiratecnopolo.pt (dns1.madeiratecnopolo.pt [89.109.64.1]) by pigeon.gentoo.org (Postfix) with ESMTP id 09ECBE06E7 for ; Thu, 6 Jan 2011 11:01:23 +0000 (UTC) Received: from [192.168.2.35] (vlan2.madeiratecnopolo.pt [89.109.64.202]) by smtp1.madeiratecnopolo.pt (Postfix) with ESMTP id 245BA5725FD for ; Thu, 6 Jan 2011 11:01:22 +0000 (WET) Subject: Re: [gentoo-amd64] Re: Some multimedia keys not working From: Clemente Aguiar To: gentoo-amd64@lists.gentoo.org In-Reply-To: References: <1294241958.18513.6.camel@caguiar-gentoo.madeiratecnopolo.pt> Content-Type: text/plain; charset="UTF-8" Date: Thu, 06 Jan 2011 11:01:21 +0000 Message-ID: <1294311681.28668.81.camel@caguiar-gentoo.madeiratecnopolo.pt> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-amd64@lists.gentoo.org Reply-to: gentoo-amd64@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 0b81c256-86d8-4b36-b745-472a27aa6a97 X-Archives-Hash: cd9b41932670ef7f7d41ce6d57e9c4cd Qui, 2011-01-06 =C3=A0s 02:25 +0000, Duncan escreveu: > Clemente Aguiar posted on Wed, 05 Jan 2011 15:39:18 +0000 as excerpted: >=20 > > I have a Microsoft Wireless Multimedia Keyboard 1.0A, and some of the > > multimedia keys are not working in Gnome, for instance the "My > > Documents", "My Images", "My Music), etc. > >=20 > > I see that there are definitions for these keys for microsoftmult > > in /usr/share/X11/xkb/symbols/inet, however when I check the keyboard > > settings with the following command it does not seem to be using them= . > >=20 > > # setxkbmap -print -verbose 10 > > Setting verbose level to 10 > > locale is C > > Applied rules from evdev: > > rules: evdev > > model: microsoftmult > > layout: pt > > options: grp:alts_toggle > > Trying to build keymap using the following components: > > keycodes: evdev+aliases(qwerty) > > types: complete > > compat: complete > > symbols: pc+pt > > +inet(evdev)+level3(ralt_switch_for_alts_toggle)+group(alts_toggle) > > geometry: pc(pc104) > > xkb_keymap { > > xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { > > include "complete" }; > > xkb_compat { include "complete" }; > > xkb_symbols { include "pc+pt > > +inet(evdev)+level3(ralt_switch_for_alts_toggle)+group(alts_toggle)" = }; > > xkb_geometry { include "pc(pc104)" }; > > }; > >=20 > > How do I configure this keyboard correctly? >=20 > Try running xev (emerge it if necessary, it's a tiny app) from a termin= al=20 > window. This should popup a small X window with a smaller window insid= e. =20 > When it has the focus, you'll get a running list of "X EVents" (thus xe= v)=20 > on its STDOUT -- the terminal window. These will include mouse movemen= t=20 > and clicks, keyboard keypress/release events, window focus/unfocus even= ts,=20 > etc. Of course what we're interested in here are the keyboard events..= . >=20 > FWIW, I have a Logitech media/inet cordless keyboard here[1], so I know= =20 > the issues with extra keys, altho I run KDE as when it comes to my=20 > computer I'm a control freak (so Gentoo's perfect for me! =3D:^), and K= DE=20 > allows more in depth customization -- including both kde environment le= vel=20 > and application level keyboard acceleration customization -- than Gnome= =20 > tends to. >=20 > Anyway, the first thing you need to do is to make sure X is recognizing= =20 > the "extra" keys and returning appropriate key-names. Here's an excerp= t=20 > from xev's output as I hit (actually release) one of mine (indent modif= ied=20 > slightly to avoid line-wrap as posted): >=20 > KeyRelease event, serial 33, synthetic NO, window 0x4400001, > root 0x111, subw 0x0, time 824814070, (75,95), root:(79,1915), > state 0x0, keycode 180 (keysym 0x1008ff18, XF86HomePage), same_screen = YES, > XLookupString gives 0 bytes:=20 > XFilterEvent returns: False >=20 > See that XF86HomePage? That's the name that key is assigned. Here's a= =20 > similar event for the escape key (no indent mod needed, escape is short= =20 > enough it doesn't extend the line far enough to wrap): >=20 > KeyRelease event, serial 34, synthetic NO, window 0x4400001, > root 0x111, subw 0x0, time 824817164, (75,95), root:(79,1915), > state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES, > XLookupString gives 1 bytes: (1b) " > XFilterEvent returns: False >=20 > Given that your posted setxkbmap settings say microsoftmult and include= =20 > inet(evdev), there's a good chance xev will report the extra key events= =20 > with registered keynames. FWIW, with newer xorg and evdev (I'm running= =20 > ~amd64 plus some stuff from the x11 and kde overlays), you shouldn't ev= en=20 > need microsoftmult -- my model is reported simply as pc101, but symbols= =20 > include inet(evdev) and everything "just works" now, unlike years ago w= hen=20 > I remember having to figure out what new rules I needed and fix all my=20 > shortcuts to work with the new names, as an upgrade had broken the old=20 > ones. >=20 > Once you see that xev is recognizing and reporting the keys, it /should= /=20 > be a simple matter of setting up keyboard shortcuts appropriately to us= e=20 > the names xev reports. I know it's simple enough to do on kde, but=20 > gnome... isn't known for making keyboard shortcut customizations (among= =20 > others) as simple and straightforward as it might, one of the reasons I= =20 > strongly prefer kde, and don't have gnome on my system (tho I do have g= tk > +, for pan and firefox). >=20 > But the first thing to find out is whether xev's seeing the keys and wh= at=20 > they're called. (I've had names for the same keys change out on me=20 > before, as I upgraded, tho with evdev they seem to be getting more=20 > standardized and stable.) If xev doesn't have names registered or does= n't=20 > see the key at all, it's an X/evdev level (or lower, kernel) key-mappin= g=20 > issue. If xev is reporting the keys properly, it's a desktop environme= nt=20 > and/or hotkey-app mapping issue. >=20 > FWIW, if gnome's hotkey mapping isn't sufficient for you, take a look a= t=20 > xhotkeys (not in the tree, apparently) and x11-misc/xbindkeys (this one= =20 > can take a simple or advanced config, with the advanced config using gu= ile=20 > scripting so you can do things like check delay to do something differe= nt=20 > with a long vs short keypress, or multiple key sequences). Both of the= se=20 > are environment independent. I researched them as a result of a still=20 > unfixed regression in multi-key recognition between kde3 and kde4, but=20 > only the guile-scripted mode of xbindkeys would have been advanced enou= gh=20 > for what I needed, and as I was trying to absorb that, I realized that = I=20 > could do very close to the same thing using a khotkey single-key trigge= r=20 > to launch a custom bash script to catch the second key, and since I=20 > already know bash reasonably well, I went that way rather than trying t= o=20 > learn guile to get xbindkeys doing what I wanted. >=20 > There's also gtkhotkey, which might be more appropriate for gnome users= ,=20 > but the Gentoo one-line description says it's a library, and the homepa= ge=20 > is launchpad, without any reasonable description I can find, so I don't= =20 > know if it includes a hotkey app that can be run or if it is indeed jus= t a=20 > library, to be used by (other) apps. >=20 > ---- > [1] I tried an MS cordless keyboard/mouse at some point but was frustra= ted=20 > with it. I'm guessing that the MS drivers include some sort of Tx gain= =20 > control for the keyboard, and that without those drivers, it defaulted = to=20 > low-power on Linux. Or maybe I just got a bad one -- it happens. All = I=20 > know is that I had a terrible time with it as even with the receiver ri= ght=20 > next to it, it would often have trouble detecting keys. So I went back= to=20 > Logitech, which has always worked well. I run xev and the result on the 3 keys that I first mentioned are as follows: If press "My Documents" I get the following events: KeyPress event, serial 33, synthetic NO, window 0x4000001, root 0x1ad, subw 0x0, time 67664120, (686,264), root:(879,344), state 0x10, keycode 120 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes:=20 XmbLookupString gives 0 bytes:=20 XFilterEvent returns: False KeyRelease event, serial 33, synthetic NO, window 0x4000001, root 0x1ad, subw 0x0, time 67664246, (686,264), root:(879,344), state 0x10, keycode 120 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes:=20 XFilterEvent returns: False If I press "My Images" or "My Music" nothing happens. I then tried to see what happened at console level, with showkey. When I press "My Documents" I get the following keycodes: keycode 112 press keycode 112 release and the following scan codes 0xe0 0x6f 0xe0 0xef With the other two keys I get nothing. Then I read the following in the showkey manual: "In 2.6 kernels raw mode, or scancode mode, is not very raw at all. Scan codes are first translated to key codes, and when scancodes are desired, the key codes are translated back. Various transformations are involved, and there is no guarantee at all that the final result corresponds to what the keyboard hardware did send. So, if you want to know the scan codes sent by various keys it is better to boot a 2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=3D0 that tells the 2.6 kernel to return the actual scan codes." So I booted my 2.6 kernel with the option atkbd.softraw=3D0 and the scan codes I got where the following: "My Documents" key -> 0xe0 0x4c 0xe0 0xcc "My Images" key -> 0xe0 0x64 0xe0 0xe4 "My Music" key -> 0xe0 0x3c 0xe0 0xbc Where do I go from here? Any further help will be appreciated.