all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP>
To: help-gnu-emacs@gnu.org
Subject: Re: translating numpad keys in linux terminal
Date: Thu, 2 Apr 2015 10:49:09 +0000 (UTC)	[thread overview]
Message-ID: <mfj6r4$leh$1@dont-email.me> (raw)
In-Reply-To: mailman.3029.1427728348.31049.help-gnu-emacs@gnu.org

On 2015-03-30, Tim Johnson <tim@akwebsoft.com> wrote:
> With emacs 24 on linux ubuntu 14.04 
>
> Gui emacs translates all numeric keypad keys except the backspace as
> distinct from the equivalent on the main keyboard.
>
> Example : kp-up vs. up
>
> Unfortunately, my preference is emacs -nw from the terminal, which
> in this case is gnome-terminal. emacs -nw only translates 
> kp-(divide, multiply, minus, plus and enter).
>
> Is there a way to read the other keys with "kp-" as in gui emacs?
>

Yes. (I currently rely on this ability for some of my workflow as
I use the EDT keypad layout when editing in emacs.)

You need a decent terminal emulator which supports DEC keyboard
escape sequences correctly and can go into application keypad mode.
For me, xterm with a script[*] I picked up from comp.os.vms a decade
or so qualifies as does the pterm component of PuTTY.

In both cases, I am running the keyboard permanently in application
keypad mode, rather than messing around with going in and out of
application keypad mode when entering/exiting emacs. This may not be
suitable for you and you may choose to do the switching yourself
as required.

You then have two choices:

1) You can look at a version of tpu-edt.el from early emacs 22.x or
before which shows how to turn the incoming escape sequences into
something can be processed within your emacs code.

2) Sometime after this, tpu-edt.el was rewritten to drop the direct
processing of escape sequences (and utterly breaking character cell
support in the process; I've only just discovered this after switching
to a newer LTS version of Linux and I've just notified the tpu-edt.el
author).

However, even in this broken version, when TERM is set to vt200, the
keypad keys other than PF1-PF4 still work when in application keypad
mode, so this might be enough for you. If so, have a look at a current
version of tpu-edt.el and you might be able to see something which you
can use; this would appear to be an easier approach than directly
processing escape sequences in your case.

Simon.

[*] There's a script on http://invisible-island.net/xterm/xterm.faq.html
which might help you get started if you choose this approach; you want
one which maps Num Lock to PF1; these specific scripts I have not tested
however.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world


  parent reply	other threads:[~2015-04-02 10:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3029.1427728348.31049.help-gnu-emacs@gnu.org>
2015-04-01 23:46 ` translating numpad keys in linux terminal Dan Espen
2015-04-02 10:49 ` Simon Clubley [this message]
2015-04-02 23:10   ` Emanuel Berg
2015-04-02 23:45     ` Richard Wordingham
     [not found]     ` <mailman.3207.1428018356.31049.help-gnu-emacs@gnu.org>
2015-04-03  0:48       ` Emanuel Berg
2015-04-03  1:23         ` Emanuel Berg
2015-04-03  1:25         ` Dan Espen
2015-04-03  1:46           ` Emanuel Berg
2015-04-03  2:56             ` Tim Johnson
     [not found]             ` <mailman.3215.1428029828.31049.help-gnu-emacs@gnu.org>
2015-04-03  3:38               ` Dan Espen
2015-04-03 13:35     ` Simon Clubley
2015-04-05 23:39       ` Emanuel Berg
2015-03-30 15:12 Tim Johnson
2015-04-01 10:08 ` Michael Heerdegen
     [not found] ` <mailman.3119.1427882930.31049.help-gnu-emacs@gnu.org>
2015-04-01 14:33   ` Pascal J. Bourguignon
2015-04-01 15:37     ` Tim Johnson
     [not found]     ` <mailman.3140.1427902682.31049.help-gnu-emacs@gnu.org>
2015-04-01 16:28       ` Pascal J. Bourguignon
2015-04-01 18:57         ` Tim Johnson
2015-04-01 23:23     ` 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='mfj6r4$leh$1@dont-email.me' \
    --to=clubley@remove_me.eisner.decus.org-earth.ufp \
    --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.