unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: C-<digit> key bindings not working on console
Date: Thu, 23 Jan 2014 23:08:03 +0100	[thread overview]
Message-ID: <8761patkpv.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: mailman.12639.1390494920.10748.help-gnu-emacs@gnu.org

Thorsten Jolitz <tjolitz@gmail.com> writes:

>> That's got nothing to do with Emacs: your
>> text-terminal is the culprit.  But don't worry: it's
>> not just your text-terminal, it's all(?) known
>> text-terminals.  Of course, you can configure your
>> text-terminal (e.g. Linux's console) to send a
>> different escape sequence for those chars, and then
>> tell Emacs to recognize those sequence.
>
> I once investigated how to do that kind of thing,
> unfortunately I forgot most of it by now and will
> have relearn it.

Linux console/VT/tty solution - tested on Debian.

I didn't figure out this myself, someone told me, just
as I tell someone, now. But because this question comes
now and then, it would be good to get feedback from the
OP, because then I can make adjustments and, if all
good and well, use this text next time around as
well. Use, reuse, and not reinventing the wheel,
remember? OK:

Put, in /etc/console-setup/remap.inc

control keycode 11 = U+0110

11 is 0, and you get that from 'showkey'. [If you use
tmux on top of the VT, use 'sudo showkey' (every time)
or 'chmod u+s /usr/bin/showkey' (once, then just
'showkey'). Find out where 'showkey' is with 'type' in
bash, and 'type' or 'where' in zsh.]

The Unicode (U+0110) is arbitrary in the sense it
doesn't matter what it is as long as it isn't in use
already, so make it exotic.

Then: 'sudo loadkeys /etc/console-setup/remap.inc'

Next, in an Emacs init file (.emacs, or if you want to
put such things somewhere else, and then `load-file'
from the main init file), in such a file, put:

(define-key input-decode-map [?\u0110] [C-zero])

Now, hit C-0 and it should say "<C-zero> is undefined",
which means you can bind it to whatever:

(global-set-key (kbd "<C-zero>") 'switch-buffer)

Note: Because you want to load the modified keymap when
booting the system, but without having to give the sudo
password, one way to do that on Debian is to put

loadkeys /etc/console-setup/remap.inc > /dev/null

in /etc/rc.local

-- 
underground experts united:
http://user.it.uu.se/~embe8573


  parent reply	other threads:[~2014-01-23 22:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 10:50 C-<digit> key bindings not working on console Thorsten Jolitz
2014-01-23 11:00 ` Thorsten Jolitz
2014-01-23 12:48   ` Tassilo Horn
2014-01-23 13:00     ` Thorsten Jolitz
2014-01-23 13:39       ` Tassilo Horn
2014-01-23 14:17 ` Stefan Monnier
2014-01-23 16:35   ` Thorsten Jolitz
2014-01-23 16:57     ` Stefan Monnier
2014-01-27  9:18       ` Thorsten Jolitz
     [not found]   ` <mailman.12639.1390494920.10748.help-gnu-emacs@gnu.org>
2014-01-23 22:08     ` Emanuel Berg [this message]
2014-01-27 10:10       ` Thorsten Jolitz
     [not found]       ` <mailman.12925.1390817447.10748.help-gnu-emacs@gnu.org>
2014-01-27 16:50         ` Emanuel Berg
     [not found] <mailman.12620.1390474210.10748.help-gnu-emacs@gnu.org>
2014-01-27  8:59 ` Javier
2014-01-27 10:25   ` Thorsten Jolitz

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=8761patkpv.fsf@nl106-137-194.student.uu.se \
    --to=embe8573@student.uu.se \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).