all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* input-decode-map: Silently ignore certain sequences
@ 2018-12-13 19:10 Yuri Khan
  2018-12-13 22:43 ` Stefan Monnier
  2018-12-16 12:20 ` Anders Lindgren
  0 siblings, 2 replies; 6+ messages in thread
From: Yuri Khan @ 2018-12-13 19:10 UTC (permalink / raw)
  To: Emacs developers

Hello emacs-devel,

I am trying to implement an input-decode-map for the Kitty terminal
emulator [1], specifically, for its full keyboard mode extension [2].
This would solve one of the two major deficiences of Emacs in a
terminal emulator, namely, the inability to distinguish many
keystrokes. (The other one, lack of full color, is also solved by
Kitty, with the right terminfo modifications.)

In the full keyboard mode, the terminal passes to the application
*all* keystrokes, in a very machine-friendly format. That is, for
events other than character input (i.e. normal characters, shifted
characters, Enter, Tab, and Backspace), it sends an escape sequence
containing a key code, a modifier bit mask, and whether the key was
pressed, released, or autorepeated.

This is a bit too much for an application such as Emacs; in
particular, it is not interested in key release events, or events
regarding modifier keys.

To give an example, Kitty sends the sequence “ESC _ K p A B b ESC \”
for the event “Left Alt pressed”.

I can get Emacs to ignore this sequence by doing this:

    (define-key input-decode-map "\e_KpABb\e\\" [])

However, input decoding is accompanied by echoing the current key
sequence prefix, and when the sequence is complete, Emacs clears the
echo area. With key release events, this happens *a lot*. This is
suboptimal because sometimes Emacs asks a question in the echo area
and waits for a key.

For example, when the user presses C-x C-c, (kill-emacs) may ask
whether to save files. Then the release event for C-c comes, and the
echo area is cleared.

Is there a way to turn off echoing for prefixes of sequences matched
against input-decode-map, so that echoing still works for “manual” key
sequences but not sequences sent by the terminal?

If not, would such an option be considered useful?


[1]: https://sw.kovidgoyal.net/kitty/
[2]: https://sw.kovidgoyal.net/kitty/protocol-extensions.html#keyboard-handling



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-17  3:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-13 19:10 input-decode-map: Silently ignore certain sequences Yuri Khan
2018-12-13 22:43 ` Stefan Monnier
2018-12-15  8:18   ` Yuri Khan
2018-12-16 12:20 ` Anders Lindgren
2018-12-16 14:35   ` Yuri Khan
2018-12-17  3:24     ` Stefan Monnier

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.