Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Emacs ignores Control key in console mode

1 view
Skip to first unread message

Oscar Fuentes

unread,
Dec 8, 2001, 9:40:04 PM12/8/01
to
Hi!

I'm using emacs 21.1.1 on RedHat 6.2.

In console mode, the Control key does not works combined with 'end',
'home', etc.:

emacs -q

C-h c C-home

prints

<home>

Any idea?

--
Oscar.

Eli Zaretskii

unread,
Dec 8, 2001, 11:15:01 PM12/8/01
to
Oscar Fuentes wrote:
>
> In console mode, the Control key does not works combined with 'end',
> 'home', etc.:
>
> emacs -q
>
> C-h c C-home
>
> prints
>
> <home>

What does "C-h l" show after you press C-home? Most terminals simply don't
distinguish between home and C-home, so Emacs cannot support C-home on them.

Oscar Fuentes

unread,
Dec 9, 2001, 9:39:29 AM12/9/01
to
Eli Zaretskii <el...@is.elta.co.il> writes:

> Oscar Fuentes wrote:
> >
> > In console mode, the Control key does not works combined with 'end',
> > 'home', etc.:
> >
> > emacs -q
> >
> > C-h c C-home
> >
> > prints
> >
> > <home>
>
> What does "C-h l" show after you press C-home?

ESC [ 1 ~ C-h l

> Most terminals simply don't distinguish between home and C-home, so
> Emacs cannot support C-home on them.

This is a PC.

I suspect this is a terminal configuration problem and I'm a *nix
beginner. Could you give some advice about where to start to fix this?

Thanks.

--
Oscar.

Eli Zaretskii

unread,
Dec 9, 2001, 11:17:41 AM12/9/01
to
Oscar Fuentes wrote:
>
> Eli Zaretskii <el...@is.elta.co.il> writes:
>
> > Oscar Fuentes wrote:
> > >
> > > In console mode, the Control key does not works combined with 'end',
> > > 'home', etc.:
> > >
> > > emacs -q
> > >
> > > C-h c C-home
> > >
> > > prints
> > >
> > > <home>
> >
> > What does "C-h l" show after you press C-home?
>
> ESC [ 1 ~ C-h l

And is that different from what it says after just home?

> > Most terminals simply don't distinguish between home and C-home, so
> > Emacs cannot support C-home on them.
>
> This is a PC.

So? It doesn't necessarily matter, since the keystroke goes through
multiple layers of processing in various parts of the OS before it ends up
inside Emacs. Even if the keyboard driver on its lower level knows you
pressed a Ctrl key together with Home, it doesn't mean the higher layers
report that to Emacs.

Oscar Fuentes

unread,
Dec 9, 2001, 1:30:33 PM12/9/01
to
Eli Zaretskii <el...@is.elta.co.il> writes:

> > > What does "C-h l" show after you press C-home?
> >
> > ESC [ 1 ~ C-h l
>
> And is that different from what it says after just home?

It's the same.



> > > Most terminals simply don't distinguish between home and C-home, so
> > > Emacs cannot support C-home on them.
> >
> > This is a PC.
>
> So? It doesn't necessarily matter, since the keystroke goes through
> multiple layers of processing in various parts of the OS before it ends up
> inside Emacs. Even if the keyboard driver on its lower level knows you
> pressed a Ctrl key together with Home, it doesn't mean the higher layers
> report that to Emacs.

I think I've said on the msg you quoted that it seems a terminal
configuration problem. Also said that I'm a beginner on Linux. AFAIK,
the problem is not Emacs, but the way things are configured on my
system. As this is a PC running a renowned Linux distro I expected
that it would install with the proper configuration to make the
terminal work using the full capabilities of the PC keyboard. As you
pointed out, nothing to do with Emacs, so I think I'll try on the
redhat mailing lists.

Thanks again for your help.

--
Oscar.

Stefan Monnier <foo@acm.com>

unread,
Dec 9, 2001, 1:46:52 PM12/9/01
to
>>>>> "Oscar" == Oscar Fuentes <o...@wanadoo.es> writes:
> In console mode, the Control key does not works combined with 'end',
> 'home', etc.:

It's because the console is not configured to distinguish between the two.
You'll first need to change your console's configuration (I'm not sure
how to do that, tho. Maybe kbdconfig is a start. You might want to
ask on a GNU/Linux group).


Stefan

Alan Mackenzie

unread,
Dec 9, 2001, 5:34:50 PM12/9/01
to
Oscar Fuentes <o...@wanadoo.es> wrote on 09 Dec 2001 03:40:04 +0100:
> Hi!

> I'm using emacs 21.1.1 on RedHat 6.2.

> In console mode, the Control key does not works combined with 'end',
> 'home', etc.:

> Any idea?

Yes. The Linux tty keyboard driver is to blame.

The solution is to modify the keyboard mapping file (which will be
somewhere like /etc/default.keytab) to return distinct codes for these
key combinations, then to modify emacs to understand them.

Code to do all this was written by Kalle Niemitalo some while ago, and is
(or was) available on his (former?) website at
<http://stekt.oulu.fi/~tosi/kbd>.

I could send you my default.keytab if you want, but as it is based on a
British keyboard layout, it might not be much help.

> Oscar.

--
Alan Mackenzie (Munich, Germany)
Email: aa...@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove one of them (leaving, say, "a").

Oscar Fuentes

unread,
Dec 10, 2001, 6:05:53 PM12/10/01
to
Alan Mackenzie<no...@example.invalid> writes:

> The solution is to modify the keyboard mapping file (which will be
> somewhere like /etc/default.keytab) to return distinct codes for these
> key combinations, then to modify emacs to understand them.
>
> Code to do all this was written by Kalle Niemitalo some while ago, and is
> (or was) available on his (former?) website at
> <http://stekt.oulu.fi/~tosi/kbd>.

This solved the problem.

Thank you very much!

--
Oscar.

0 new messages