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

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

Re: C-<digit> key bindings not working on console


From: Thorsten Jolitz
Subject: Re: C-<digit> key bindings not working on console
Date: Mon, 27 Jan 2014 11:10:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Emanuel Berg <embe8573@student.uu.se> writes:

> 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

Thanks for the recipe, I'll try that out when I have enough time. 

One annoying thing is that M-<arrow-keys> (i.e. Alt-<arrow-keys>) are at
least partly (left-arrow, right-arrow) occupied by the system, in my
case Archlinux, for switching between tty's. That is convenient, but for
an Org-mode user these key-combos are much more important inside
Org-mode than for tty-navigation.

-- 
cheers,
Thorsten




reply via email to

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