From: Dan Espen <despen@verizon.net>
To: help-gnu-emacs@gnu.org
Subject: Re: translating numpad keys in linux terminal
Date: Thu, 02 Apr 2015 23:38:18 -0400 [thread overview]
Message-ID: <mfl1to$j9v$1@dont-email.me> (raw)
In-Reply-To: mailman.3215.1428029828.31049.help-gnu-emacs@gnu.org
Tim Johnson <tim@akwebsoft.com> writes:
> * Emanuel Berg <embe8573@student.uu.se> [150402 17:49]:
>> Dan Espen <despen@verizon.net> writes:
>>
>> >> Perhaps someone in this list that is familiar with
>> >> just exactly what the '-nw' option does can
>> >> enlighten us?
>> >
>> > From the docs:
>> >
>> > Don't communicate directly with the window system,
>> > disregarding the DISPLAY environment variable even
>> > if it is set. This means that Emacs uses the
>> > terminal from which it was launched for all its
>> > display and input.
>> >
>> > The terminal gets and sends X Events.
>> >
>> > Emacs gets and sends _characters_ to and from
>> > the terminal.
>> >
>> > Sometimes Emacs may get signals from the terminal,
>> > like when the terminal is resized.
>> >
>> > Emacs in a terminal does not see X Events.
>> >
>> > So, your issue is what does the terminal send to Emacs
>> > when you hit a KP key,
>> >
>> > Terminals like rxvt and xterm give you
>> > complete control.
>> >
>> > gnome-terminal, sorry, I don't use it.
>>
>> Case closed.
> Indeed.
>
> My workstation is a Mac Mini. To recap, I get unique translations
> of numeric keypad input to 'emacs' running from iTerm2.
>
> I didn't get the same uniqueness when I booted the same machine
> into ubuntu 14.04 and ran 'emacs -nw' from gnome-terminal.
>
> The terminal emulator controls what emacs gets when it is in
> terminal - this from the good people who responded to my
> inquiries.
>
> As has been pointed out, rxvt _does_ translate numeric keypad
> uniquely (unlink gnome-terminal). By starting rxvt in my setup and
> then invoking emacs -nw and then running <help>-c, I can see that
> M-O sequences are being generated (that is Alt-Shift-(the capital
> letter "O")).
The man pages describes more.
This is from an xresource file for XTerm:
XTerm*VT100.translations:#override\n\
Shift<Key>KP_9: scroll-back(1, page)\n\
Shift<Key>KP_3: scroll-forw(1, page)
The "translations" resource lets you specify
the X event and the corresponding action for that event.
So, if I wanted the un-shifted KP_9 key to
do something special I could specify:
None<Key>KP_9: string("Hi Mom!") \n\
The first part is the X event, the second part is the action
as described in the man page.
I'm guessing gnome-terminal has something equivalent
but perhaps not as flexible.
--
Dan Espen
next prev parent reply other threads:[~2015-04-03 3:38 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
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 [this message]
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='mfl1to$j9v$1@dont-email.me' \
--to=despen@verizon.net \
--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.