all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: oitofelix@riseup.net
To: help-gnu-emacs@gnu.org
Subject: Re: Bind right shift and TAB won't work
Date: Mon, 13 May 2013 17:50:32 -0300	[thread overview]
Message-ID: <fvxqvc2v.fsf@riseup.net> (raw)
In-Reply-To: <20130513083346.GB24043@hysteria.proulx.com> (Bob Proulx's message of "Mon, 13 May 2013 02:33:47 -0600")

Bob Proulx <bob@proulx.com> 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 <backtab>
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 # <backtab>
   --- 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 <Shift>+<Tab> 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 <Shift>+<Tab> 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;



  reply	other threads:[~2013-05-13 20:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-11 21:48 Bind right shift and TAB won't work Emanuel Berg
2013-05-11 22:43 ` Drew Adams
     [not found] ` <mailman.25578.1368312212.855.help-gnu-emacs@gnu.org>
2013-05-12  7:15   ` Emanuel Berg
2013-05-12 14:57     ` Peter Dyballa
2013-05-12 15:37     ` Drew Adams
     [not found]     ` <mailman.25599.1368370687.855.help-gnu-emacs@gnu.org>
2013-05-12 20:56       ` Emanuel Berg
2013-05-13  8:23         ` Bob Proulx
     [not found]     ` <mailman.25602.1368373047.855.help-gnu-emacs@gnu.org>
2013-05-12 21:23       ` Emanuel Berg
2013-05-13  5:29         ` Drew Adams
     [not found]         ` <mailman.25622.1368422975.855.help-gnu-emacs@gnu.org>
2013-05-13 16:18           ` Emanuel Berg
2013-05-12  8:53 ` Peter Dyballa
     [not found] ` <mailman.25595.1368348824.855.help-gnu-emacs@gnu.org>
2013-05-12  9:27   ` Emanuel Berg
2013-05-12 15:05     ` Peter Dyballa
     [not found]     ` <mailman.25600.1368371123.855.help-gnu-emacs@gnu.org>
2013-05-12 21:08       ` Emanuel Berg
2013-05-13  8:33         ` Bob Proulx
2013-05-13 20:50           ` oitofelix [this message]
     [not found]           ` <mailman.25684.1368478466.855.help-gnu-emacs@gnu.org>
2013-05-13 23:36             ` Emanuel Berg
2013-05-13  9:05         ` Peter Dyballa
     [not found]         ` <mailman.25627.1368435961.855.help-gnu-emacs@gnu.org>
2013-05-13 14:25           ` Barry Margolin
2013-05-13 16:13             ` Emanuel Berg
2013-05-13 18:09               ` Bob Proulx
2013-05-14  0:53                 ` oitofelix
     [not found]                 ` <mailman.25694.1368499364.855.help-gnu-emacs@gnu.org>
2013-05-15 14:33                   ` Emanuel Berg
2013-05-13 16:38             ` Peter Dyballa
2013-05-13 16:06           ` Emanuel Berg
     [not found]         ` <mailman.25626.1368434033.855.help-gnu-emacs@gnu.org>
2013-05-13 15:59           ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fvxqvc2v.fsf@riseup.net \
    --to=oitofelix@riseup.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.