Date: Tue, 15 Sep 2009 00:40:38 +0200 From: Roland Smith <rsmith@xs4all.nl> To: Polytropon <freebsd@edvax.de> Cc: Eitan Adler <eitanadlerlist@gmail.com>, Robert Huff <roberthuff@rcn.com>, freebsd-questions@freebsd.org Subject: Re: rebinding keys to functions Message-ID: <20090914224038.GA77585@slackbox.xs4all.nl> In-Reply-To: <20090914230620.2f7dd3d4.freebsd@edvax.de> References: <a0777e080909140952r18cc88b3n2b3ff1456c2542c7@mail.gmail.com> <20090914173420.GB69286@slackbox.xs4all.nl> <19118.36021.489954.856994@jerusalem.litteratus.org> <20090914230620.2f7dd3d4.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 14, 2009 at 11:06:20PM +0200, Polytropon wrote: > On Mon, 14 Sep 2009 14:34:29 -0400, Robert Huff <roberthuff@rcn.com> wrot= e: > > Roland Smith writes: > >=20 > > > > My laptop has a bunch of volume-up/down/mute internet/mail/etc=20 > > > > keys. How do I map each of them to run a specific shell > > > > command when pressed?=20 > > > =20 > > > That depends on a couple of things (assuming you're running the X > > > window system, I don't know if it is even possible on the > > > console). > > > =20 > > > First you have to make sure that you actually can see the key > > > signals. In X you can test that with xev(1). > >=20 > > If this is what I think it is, he probably can't. >=20 > For most laptop keyboards, there was (as already explained) a > specific system that handled Fn+PFx outside the OS so it worked > always. Even my old Toshiba T1600 can do that. >=20 > "Modern" laptops do it differently: Fn+PFx key combinations > have to be picked up by a specific driver that "listens" to > stange and custom keycodes outside the standard range, and then > communicate the selected purpose to the OS in order to perform > the action, e. g. raise the volume. Not all of them. My laptop is based on a quite modern cantiga (aka centrino= 2) PM45 chipset (from 2008, according to Wikipedia). The function keys for changing the creen brightness and sound volume work OK with FreeBSD, even though xev doesn't see them. So that signal seems to go directly to the hardware. Using the Fn key with the virtual numeric keypad works, and generates normal keyboard events. I haven't tested the keys that can contro= l a media player, because I don't care about them. > Even worse, "modern" laptops have replaced the simple switches > in the earophone sockets. In the past, there was a mechanical > switch that switched off the internal speakers when you inserted > a 3,5mm jack. Today, a proprietary driver has to detect if a > jack is inserted, and then switch of the speakers and then > switch on the output of the socket. I just tested that today, and it worked OK in FreeBSD. Plug in the headphon= es, they work and the speaker goes silent. So I guess it is all about how the machine is put together. Even if a chips= et has certain functionality, it is up to the board manufacturer to connect it.=20 Writing a driver to detect if headphones are connected sounds much more complicated to me than connecting a couple of switches! I mean, you'd have = to measure something like the impedance of the jack. Surely that is more expensive than a simple switch? Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkquxmYACgkQEnfvsMMhpyWhpQCgkmwwzBbGCKrOYIA+x+E2k8xJ GLYAn0t1AcAu0AJWRTsixn5t34A6JF70 =fAKK -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090914224038.GA77585>