[ltp] Mapping extra ThinkPad keys

Marius Gedminas linux-thinkpad@linux-thinkpad.org
Sun, 30 Apr 2006 22:42:06 +0300


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

Hi,

I use the following set of xmodmap commands to remap three keys on my
ThinkPad's keyboard:

  # Map the <LSGT> key (labeled '\|', left of the letter Z) to Super_L
  xmodmap -e 'keycode 94 =3D Super_L Super_L' \
          -e 'clear mod4' -e 'add mod4 =3D Super_L'

  # Map the <Forward> key to Compose (aka Multi_key)
  xmodmap -e 'keycode 233 =3D Multi_key'

  # Map the <Backward> key into Alt_R
  xmodmap -e 'keycode 234 =3D Alt_R Alt_R' \
          -e 'clear mod1' -e 'add mod4 =3D Alt_R'

This script worked perfectly until I upgraded my Ubuntu Breezy (with
X.org 6.8.2) into Dapper (with X.org 7.0.0).  Now the Alt_R mapping does
not work.  If look with xev, I can see that holding down the <Backward>
key gives me a repeating series of KeyPress and KeyRelease events like
this:

  KeyPress event, serial 29, synthetic NO, window 0x4200001,
      root 0x4c, subw 0x0, time 3964361708, (177,152), root:(182,201),
      state 0x0, keycode 234 (keysym 0xffea, Alt_R), same_screen YES,
      XLookupString gives 0 bytes:
      XmbLookupString gives 0 bytes:
      XFilterEvent returns: False

  KeyRelease event, serial 29, synthetic NO, window 0x4200001,
      root 0x4c, subw 0x0, time 3964361708, (177,152), root:(182,201),
      state 0x0, keycode 234 (keysym 0xffea, Alt_R), same_screen YES,
      XLookupString gives 0 bytes:

the symbol is right, but the interpretation isn't.

I spent about an hour today trying to write an XKB file to get the
desired effect.  Nothing worked -- after carefully looking at setxkbmap
-print and loading my keyboard configuration with setxkbmap -symbols
'whateverIhadbefore+mgthinkpad(mgthinkpad)', I just get the same effect
I got with xmodmap previously.

My efforts ranged from the straightforward

  default partial modifier_keys
  xkb_symbols "mgthinkpad" {
      key <I6A>  { [ Alt_R ] };
      modifier_map Mod1 { Alt_R };
  };

to the baroque application of various sorts of voodoo like

  default partial modifier_keys
  xkb_symbols "mgthinkpad" {
      virtual_modifiers Alt;
      // The "Back" key -- I'm going crazy trying all sorts of voodo to make
      // it act like Alt_R, and I'm not succeeding
      replace key <I6A>  {
          type =3D "ONE_LEVEL",
          symbols[Group1] =3D [ Alt_R ],
          // The following should not be required -- it should be inferred
          // from the Alt_R interpretation in the compat table.
          actions[Group1] =3D [ SetMods(modifiers=3DmodMapMods,clearLocks) =
],
          virtualModifiers =3D Alt,
          repeat =3D no
      };
      modifier_map Mod1 { Alt_R };
  };

Um... Help?  Is this an X.org bug, or am I doing something wrong?

Marius Gedminas
--=20
Your eyes are weary from staring at the CRT.  You feel sleepy.  Notice how
restful it is to watch the cursor blink.  Close your eyes.  The opinions
stated above are yours.  You cannot imagine why you ever felt otherwise.

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

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

iD8DBQFEVRMOkVdEXeem148RAjurAJ9l5csJJ3pz1LFQLXEarmnY525aAwCfY/73
VqrcXbFiDyDOPI9waP29BX0=
=O6cu
-----END PGP SIGNATURE-----

--7AUc2qLy4jB3hD7Z--