Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

How get escape sequence generated by keyboard shortcut in Emacs?

16 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Andrey Lisin

ungelesen,
28.02.2015, 10:33:5828.02.15
an help-gn...@gnu.org
Hi,

sometimes it's necessary to know what sequence generates particular
keyboard shortcut. In my case, for instance, I need to know, what escape
sequences is generated by Shift+arrow shortcut. Of course, I can look in
terminal emulator settings, but I wish there would be a way to make
Emacs show sequences it receives.

Thank you!


Tory S. Anderson

ungelesen,
28.02.2015, 11:29:0028.02.15
an Andrey Lisin, Emacs Help List
Ah; in that case, I'm not sure you can do it. I think that such low-level information probably doesn't make it to emacs; it's interpreted by the OS first. Maybe someone can correct me if I'm wrong. "Shortcuts" like <backspace> seem to be as low-level as emacs gets.

Andrey Lisin <ali...@crystalnix.com> writes:

> Hi,
>
> I’m afraid, I haven’t explained clearly. Let me provide a simple
> example. I use iTerm2 as my terminal emulator. And, for example, it
> generates ^[[1;2C for Shift+left arrow shortcut. My question is there
> a way to display this ‘^[[1;2C’ when I press Shift-left arrow inside
> Emacs? Probably, there are some specific mode.
>
> --
> Regards,
> Andrey Lisin
>
>
>
>
>
>
> On 28 Feb 2015, at 22:02, Tory S. Anderson <
> torys.a...@gmail.com> wrote:
>
> I'm not sure I completely understand your meanings for "escape
> sequences" and "keyboard shortcut", but you may find what your
> looking for in either `command-history`, `C-h k` followed by your
> keystroke, or `C-h l` to see history of your command. Are any of
> those what you're looking for?

Dan Espen

ungelesen,
28.02.2015, 12:25:0928.02.15
an
Try ^h k

then hit shift arrow.

In an rxvt, I just see <shift>.

--
Dan Espen

Javier

ungelesen,
28.02.2015, 12:52:0428.02.15
an

C-h l runs the command view-lossage. It is bound to C-h l, <f1> l, <help> l.

(view-lossage)

Display last 300 input keystrokes.

Robert Thorpe

ungelesen,
28.02.2015, 12:52:4628.02.15
an help-gn...@gnu.org, Dan Espen, Andrey Lisin
That's right C-h k shows the key you press. If it's bound then it pops
up a help buffer with the key in it and a description of what it does.
If it's unbound then it shows the key in the echo area and says
something like "C-' is undefined".

Using a terminal emulator window limits the number of keys you can use.
The keys you press are translated by the terminal emulator into the form
that actual terminals emitted, Emacs recieves the result of that. For
example, in a terminal C-m and <return> are the same. In GUI Emacs you
can remap them to different things, but in terminal Emacs both will
always do whatever C-m does.

BR,
Robert Thorpe

Andrey Lisin

ungelesen,
28.02.2015, 13:05:4828.02.15
an Javier, help-gn...@gnu.org
Nice! Thanks for help everyone!

0 neue Nachrichten