From owner-freebsd-questions@FreeBSD.ORG Mon Feb 9 09:54:26 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3C6B506 for ; Mon, 9 Feb 2015 09:54:26 +0000 (UTC) Received: from smtp-nf-106.his.com (smtp-nf-106.his.com [216.194.251.35]) by mx1.freebsd.org (Postfix) with ESMTP id 70CFC890 for ; Mon, 9 Feb 2015 09:54:25 +0000 (UTC) Received: from cuda201.his.com (cuda201.his.com [216.194.248.226]) by smtp-nf-106.his.com (Postfix) with ESMTPS id 6D8D860C57 for ; Mon, 9 Feb 2015 04:54:06 -0500 (EST) X-ASG-Debug-ID: 1423475645-061c410fdc1f36b0001-jLrpzn Received: from smtp-nf-202.his.com (smtp-nf-202.his.com [216.194.248.252]) by cuda201.his.com with ESMTP id uxCwFuJlXXarT4jn; Mon, 09 Feb 2015 04:54:05 -0500 (EST) X-Barracuda-Envelope-From: tom@invisible-island.net X-Barracuda-RBL-Trusted-Forwarder: 216.194.248.252 Received: from mail-sterling.his.com (mail-sterling.his.com [216.194.248.141]) by smtp-nf-202.his.com (Postfix) with ESMTP id 77750600B2; Mon, 9 Feb 2015 04:54:05 -0500 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail-sterling.his.com (Postfix) with ESMTP id C4A1A3F80002; Mon, 9 Feb 2015 04:54:04 -0500 (EST) X-Barracuda-RBL-Trusted-Forwarder: 216.194.248.141 X-Virus-Scanned: amavisd-new at mail-sterling.his.com Received: from mail-sterling.his.com ([127.0.0.1]) by localhost (mail-sterling.his.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UOkTRTp6w-Df; Mon, 9 Feb 2015 04:54:03 -0500 (EST) Received: from aerie (pool-71-178-218-187.washdc.fios.verizon.net [71.178.218.187]) by mail-sterling.his.com (Postfix) with ESMTPSA id D1C553F80001; Mon, 9 Feb 2015 04:54:03 -0500 (EST) Received: from tom by aerie with local (Exim 4.72) (envelope-from ) id 1YKl2b-00006b-4s; Mon, 09 Feb 2015 04:54:05 -0500 X-Barracuda-Apparent-Source-IP: 71.178.218.187 Date: Mon, 9 Feb 2015 04:54:05 -0500 From: Thomas Dickey To: Matthias Apitz , Thomas Dickey , freebsd-questions@freebsd.org Subject: Re: key Shift+Prior not working for scroll-up in xterm but in urxvt Message-ID: <20150209095405.GA32691@aerie.jexium-island.net> X-ASG-Orig-Subj: Re: key Shift+Prior not working for scroll-up in xterm but in urxvt Reply-To: dickey@his.com References: <20150206081525.GA1828@c720-r276659> <20150206092525.GA3070@aerie.jexium-island.net> <20150206130348.GA2764@c720-r276659> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <20150206130348.GA2764@c720-r276659> User-Agent: Mutt/1.5.20 (2009-06-14) X-Barracuda-Connect: smtp-nf-202.his.com[216.194.248.252] X-Barracuda-Start-Time: 1423475645 X-Barracuda-URL: https://spam.his.com:443/cgi-mod/mark.cgi Received-SPF: none (his.com: tom@invisible-island.net does not designate permitted sender hosts) X-Virus-Scanned: by bsmtpd at his.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=7.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.15071 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2015 09:54:26 -0000 --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 06, 2015 at 02:03:48PM +0100, Matthias Apitz wrote: > El d=C3=ADa Friday, February 06, 2015 a las 04:25:25AM -0500, Thomas Dick= ey escribi=C3=B3: >=20 > > > I run this 11C on a small netbook (Acer C720) which does not have phy= sical > > > keys for PG_UP/DOWN; that's why I use xmodmap to define=20 > > >=20 > > > Mode_switch + UP --> Prior > > > Mdee_switch + Down --> Next > > >=20 > > > xmodmap -e "keycode 98 =3D Up Up Prior" > > > xmodmap -e "keycode 104 =3D Down Down Next" > > >=20 > > > When I now do in the terminal urxvt holding down both Mode_switch and > > > Shift, it scrolls fine with the Up and Down keys as expected: the > > > terminal window is scrolled up and down. > > >=20 > > > When I do the same, the key is delivered to the xterm itself and I can > > > see them, for example, with 'od -c' as: > > >=20 > > > $ od -c > > > ^[[5;2~^[[5;2~ > > > ^[[6;2~^[[6;2~ > > > 0000000 033 [ 5 ; 2 ~ 033 [ 5 ; 2 ~ \n 033 [ = 6 > > > 0000020 ; 2 ~ 033 [ 6 ; 2 ~ \n = =20 > > > 0000032 > > >=20 > > > The 033 [ 5 ; 2 ~ for Up and the 033 [ 6 ; 2 ~ for down. > > >=20 > > > Why this does not work in xterm? > >=20 > > That depends on what you want it to do (you did not say). >=20 > I think, I said what I want: that with Mode_switch+Shift+Up/Down it does > scrolling in xterm as it does in uRxvt. >=20 > I followed your hints an tried configurations in the file > ~/.Xdefaults-hostname: >=20 > *VT100.translations: #override \ > ShiftUp: scroll-back(1,page) \n\ > ShiftDown: scroll-forw(1,page) \n\ > ShiftF9: string("hola") >=20 > (the last line for F9 is only to see if the file works at all). >=20 > With the above config it now scrolls in xterm with Shift-Up/Down. But > I'm unable to configure that it scrolls with Mode_switch+Shift+Up/Down > and I want to have this to use the same key sequence in xterm and uRxvt > and not always have to think where I am. >=20 > Any idea? Thanks not immediately: my keyboard does not have a mode_switch key (unless I tinker with xmodmap...). But here's a guess: Xt's translations don't know about mode_switch as such, so a fix is likely to be in xmodmap. While xmodmap's manpage is vague about the recognized modifiers, mentioning them by name only once: clear MODIFIERNAME This removes all entries in the modifier map for the given m= od=E2=80=90 ifier, where valid name are: Shift, Lock, Control, Mod1, Mo= d2, Mod3, Mod4, and Mod5 (case does not matter in modifier nam= es, although it does matter for all other names). For examp= le, ``clear Lock'' will remove all any keys that were bound to = the shift lock modifier. The source code for the xmodmap program does not have a table of these name= s. That is in the library. The library defines this table: static ModifierRec modifiers[] =3D { {"Shift", 0, ParseModImmed,ShiftMask}, {"Lock", 0, ParseModImmed,LockMask}, {"Ctrl", 0, ParseModImmed,ControlMask}, {"Mod1", 0, ParseModImmed,Mod1Mask}, {"Mod2", 0, ParseModImmed,Mod2Mask}, {"Mod3", 0, ParseModImmed,Mod3Mask}, {"Mod4", 0, ParseModImmed,Mod4Mask}, {"Mod5", 0, ParseModImmed,Mod5Mask}, {"Meta", 0, ParseModSym, XK_Meta_L}, {"m", 0, ParseModSym, XK_Meta_L}, {"h", 0, ParseModSym, XK_Hyper_L}, {"su", 0, ParseModSym, XK_Super_L}, {"a", 0, ParseModSym, XK_Alt_L}, {"Hyper", 0, ParseModSym, XK_Hyper_L}, {"Super", 0, ParseModSym, XK_Super_L}, {"Alt", 0, ParseModSym, XK_Alt_L}, {"Button1", 0, ParseModImmed,Button1Mask}, {"Button2", 0, ParseModImmed,Button2Mask}, {"Button3", 0, ParseModImmed,Button3Mask}, {"Button4", 0, ParseModImmed,Button4Mask}, {"Button5", 0, ParseModImmed,Button5Mask}, {"c", 0, ParseModImmed,ControlMask}, {"s", 0, ParseModImmed,ShiftMask}, {"l", 0, ParseModImmed,LockMask}, }; and also in the library it treats the mode-switch specially (without naming it): InitialI.h:307: Modifiers mode_switch; /* keyboard group modifi= ers */ TMkey.c:451: pd->mode_switch =3D 0; TMkey.c:464: if ((keysym =3D=3D XK_Mode_switch) && (i > 2)) TMkey.c:465: pd->mode_switch |=3D 1 << i; TMkey.c:531: *modifiers_return =3D (ShiftMask|LockMask) | pd->mode_switc= h | pd->num_lock; TMkey.c:541: if ((per > 2) && (modifiers & pd->mode_switch)) { So... I think that you could make this work by using xmodmap to assign one of the mod1-mod5 modifier names to the mode-switch key, and using that modifier in a translations resource binding for xterm. --=20 Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAlTYg70ACgkQcCNT4PfkjtsTSACg3PYoZzvq8ciKtHSCzapWyZYI SsgAoK7t6xjKoIBwP0v0RsKbFNp6+cN0 =3dzR -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V--