[code] Re: backspace again + translated strings

From: Joshua Krämer <joshua.kraemer.att.gmail.com>
Date: Thu, 14 Aug 2014 12:06:13 +0200

On 2014-08-13, 21:03, Mitchell wrote:

> Okay I've spent some time looking into this and discovered that
> libtermkey likes to combine ^H and ^? into a backspace symbol (which
> Textadept then interprets as ASCII 8, or '\b'). I've committed a
> change that segregates these two keys. ^H is now reported as 'ch',
> while ^? is still reported as '\b'. It's not perfect, but at least
> one can distinguish between Backspace and ^H now.

Hi Mitchell. Thanks for your efforts. However, I don't think this is
the way to go. If I understand you correctly, your change results in
ASCII 8 = BS being recognized as Ctrl-h. This means that ASCII 8 and
ASCII 127 can now be distinguished, but on terminals where the
backspace key sends ASCII 127, it is no longer possible to distinguish
the backspace key and Ctrl-h!

I do not think it is really necessary to distinguish ASCII 8 (BS) and
ASCII 127 (DEL), because terminals normally use one of them only.
Thus, libtermkey's solution to treat both as BS seems to be acceptable
to me. On the other hand, people may wish to distinguish between the
backspace key and Ctrl-h (I do, for instance). This is not possible if
BS or DEL are hardcoded to be recognized as Ctrl-h.

> (By the way, I tried to also segregate Tab from ^I, Enter from ^M,
> and Esc from ^[ with no success; those keys will remain coupled.)

There is no need to do anything here. Libtermkey already cares for
this. In fact, this is the whole point of libtermkey. One only has to
configure the terminal to use CSI u encoding for these keys, and they
will be encoded unambigously. It already works perfectly in Textadept!

See: http://www.leonerd.org.uk/hacks/fixterms/

If you use xterm for example, add this to your .Xresources, and you will
be able to assign keys.ci independent of the tab key:

*VT100.Translations: #override \n\
        Ctrl<Key>i: string("") \n

Kind regards,
Joshua

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 14 Aug 2014 - 06:06:13 EDT

This archive was generated by hypermail 2.2.0 : Thu 14 Aug 2014 - 06:42:22 EDT