[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Input for TTY menus
From: |
Eli Zaretskii |
Subject: |
Re: Input for TTY menus |
Date: |
Mon, 23 Sep 2013 16:18:02 +0300 |
> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Thu, 19 Sep 2013 15:21:17 -0400
>
> >> read_char won't handle the arrow keys. To handle the arrow keys you
> >> need to use read_key_sequence
> > Thanks. This means I'll probably need to clone some small subset of
> > the code in command_loop_1 after it calls read_key_sequence, in order
> > to process the key sequence, right?
>
> I don't think there's much to do there, but clearly you'll want to do
> something with the sequence, indeed. Although you might like to simply
> setup your keymaps in such a way that you can just use
> read_key_sequence_cmd (which should usually be the same as (key-binding
> <keys>), except when the keymaps are dynamic and might change between
> the time they were read by read_key_sequence and the call to
> key-binding) to know what operation to perform.
>
> >> (probably after setting up some overriding-terminal-local-map).
> > What would be the purpose of overriding-terminal-local-map in this
> > case?
>
> The key sequences read by read_key_sequence depend on the currently
> active keymaps to decide when a key sequence is complete (i.e. when to
> stop reading subsequent events).
Is it OK to bind keys in overriding-terminal-local-map to symbols
whose function cell is void? (The C code interprets these symbols
when they are delivered by read_key_sequence via
read_key_sequence_cmd.) It seems to work, but I wonder if that is
just be sheer luck, and should be discouraged for some reason.