From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: oitofelix@riseup.net Newsgroups: gmane.emacs.help Subject: Re: Bind right shift and TAB won't work Date: Mon, 13 May 2013 17:50:32 -0300 Message-ID: References: <20130513083346.GB24043@hysteria.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368478476 24335 80.91.229.3 (13 May 2013 20:54:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 May 2013 20:54:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 13 22:54:35 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UbzlS-0007cI-Rz for geh-help-gnu-emacs@m.gmane.org; Mon, 13 May 2013 22:54:34 +0200 Original-Received: from localhost ([::1]:35326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbzlS-0007n5-JG for geh-help-gnu-emacs@m.gmane.org; Mon, 13 May 2013 16:54:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubzf6-00078I-RZ for help-gnu-emacs@gnu.org; Mon, 13 May 2013 16:48:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ubzf4-000610-4o for help-gnu-emacs@gnu.org; Mon, 13 May 2013 16:48:00 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:41224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubzf3-00060d-VK for help-gnu-emacs@gnu.org; Mon, 13 May 2013 16:47:58 -0400 Original-Received: from fruiteater.riseup.net (fruiteater-pn.riseup.net [10.0.1.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Gandi Standard SSL CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id BFD104F69D for ; Mon, 13 May 2013 13:47:20 -0700 (PDT) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: oitofelix@fruiteater.riseup.net) with ESMTPSA id 0CD36C22 In-Reply-To: <20130513083346.GB24043@hysteria.proulx.com> (Bob Proulx's message of "Mon, 13 May 2013 02:33:47 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-Virus-Scanned: clamav-milter 0.97.8 at mx1 X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 198.252.153.129 X-Mailman-Approved-At: Mon, 13 May 2013 16:54:25 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90724 Archived-At: Bob Proulx writes: > I think you must be either using the Linux vt virtual console or are > using a terminal emulator that does not implement S-TAB. If you are > using a Linux virtual console there isn't any way around this without > patching Linux. It is not true. I have setup my console (kernel and xterm) Emacs' frames to work almost identical to the X Window ones. Let's attack the kernel console issue. The trick is to use kernel keymaps. Here is how it works for the specific problem being discussed (the detection): 1. Discover what is your Tab key code using the command line program `showkey'. Mine is 15; so, let's suppose also it is yours. 2. Create a keymap that include your base keymap and maps the shifted Tab key to some unicode character (take a look at keymaps(5) man page). Let's suppose that your current keymap is the US one (/lib/kbd/keymaps/i386/qwerty/us.map.gz) and you want to map to the U+010E character. Thus, your keymap will be like this: --- begin emacs.map --- include "/lib/kbd/keymaps/i386/qwerty/us.map.gz" shift keycode 15 = U+010E # --- end emacs.map --- 3. Load your new keymap using the command-line program `loadkeys'. Make that command to be invoked on system start-up (put it in some rc init script). Now when you press + you should see a funny character showing up on your console. The comment at the keymap's second line remember us the purpose of that mapping and that we need to configure the Emacs side. It lead us to the next step. 4. Now when you type `C-h c' followed by + you will realize that Emacs can now detect your key press. The remaining procedure is to map that unicode character to the input event we are interested in. For this just make Emacs evaluate the following expression on start-up (put it in .emacs, for example). (define-key input-decode-map [?\u010E] [backtab]) And that is all. The xterm approach is similar and based on the same principles. I hope it helps. -- ,= ,-_-. =. There is no system but GNU; ((_/)o o(\_)) Linux-libre is just one of its kernels; `-'(. .)`-' Emacs is the only true editor; \_/ All software should be free as in freedom;