help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind right shift and TAB won't work


From: oitofelix
Subject: Re: Bind right shift and TAB won't work
Date: Mon, 13 May 2013 17:50:32 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]