[ltp] Remapping Fn-Ctrl keys on Ubuntu Gutsy

Marius Gedminas linux-thinkpad@linux-thinkpad.org
Tue, 30 Oct 2007 22:03:28 +0200


--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 30, 2007 at 06:56:56PM +0000, Richard Neill wrote:
> (*)That said, running xev (x event viwer) and pressing Fn on my T60p, doe=
s=20
> give a response: keycode 227, whereas I'd have expected nothing to happen=
=2E=20

Interestingly enough, the Fn key and the Menu key on my T61 both produce
keycode 227.

> So, you can use xmodmap. Eg:
>
>   xmodmap -e "keycode 227 =3D 0x39"
>
> That makes my machine print '8' every time it receives an 'Fn' press; it=
=20
> also leaves Fn-Home etc working.
>
> I leave getting it to work with Ctrl as an excercise - I can't figure it=
=20
> out right now!

It seems that there's a bug in the X server that won't allow you to map
a key with a keycode greater than 127 to a modifier key such as Ctrl:
https://bugs.freedesktop.org/show_bug.cgi?id=3D12401

> Also, note that you'll have to run this command every time you boot (eg=
=20
> .bashrc),

No, .bashrc is entirely the wrong place for this.  .gnomerc (if you use
GNOME) or .xsession (provided that you end the file with the appropriate
exec statement to load your default desktop).

> and that xmodmap can really mess up your keyboard while=20
> experimenting. I recommend you have a file open from which you can=20
> copy-paste characters back into your terminal.

'setxkbmap' is a command that resets your keymap if you mess it up, so
it's a good idea to have it available for mouse copying and pasting ;-)

But anyway, before bug #12401 gets fixed I doubt you can map Fn to Ctrl.

Marius Gedminas
--=20
A secret: don't tell DARPA I'm not building the sun destroying weapon they
think I am.
        -- Michael Salib, the author of Starkiller

--u3/rZRmxL6MmkK24
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHJ44QkVdEXeem148RAmArAJ4lVFzTNRTmza0e76/e4wC3Z+79pQCeIk65
G3fjvR6uxXpBCEuqJZRZjTg=
=UrU+
-----END PGP SIGNATURE-----

--u3/rZRmxL6MmkK24--