Friday, June 24, 2011

Re: What is the <80>kb character code?

On 24/06/11 17:24, Andrew Neil wrote:
> Suppose I was to type the following:
>
> qq
> oHello, Wordl!<BS><BS><BS>ld!<Esc>
> q
>
> For the purposes of illustration here, I'm using<BS> to stand for the backspace
> key, and<Esc> to stand for the escape key. Now, if I put the contents of the
> 'q' register into the document (e.g. `:put q`), it looks like this:
>
> oHello, wordl!<80>kb<80>kb<80>kbld!
>
> It looks like Vim saves the actual key codes, so instead of the<Esc> notation I
> get ^[. That much is clear, but I'm confused by the key code for the backspace
> key:<80>kb. The<80> looks like four separate characters, but it's just a
> single character. If I place my cursor on it and press `ga`, it reveals the
> following info:
>
> <Â<80>> 128, Hex 0080, Octal 200
>
> What is this character? And how does<80>kb relate to the backspace key?
>
> Thanks,
> Drew
>

<80> (or 0x80 or maybe U+0080) is a control character, internally used
by gvim to herald some pseudo-key-sequences specific to its internal
workings. It is defined in Latin1 and Unicode as a "control character"
with no further specification.

My first hypothesis was that <80>kb is gvim's internal code for the t_kb
termcap code for the "builtin-gui" terminal; this hypothesis is hard to
check in gvim because there the output of ":set termcap" doesn't include
key codes such as t_kb, and ":set t_kb?" returns E846: Keycode not set.

However, even in console mode (with 'term' set to "xterm" and 't_kb' set
to Ctrl-?) recording a <BS> key still gives me <80>kb

So my second hypothesis is that <80>kb is an internal code used by Vim
after termcap translation to mean "at this point in the input stream the
key corresponding to the t_kb termcap code was used".

See
:help 't_kb'


Best regards,
Tony.
--
Murphy's Law is recursive. Washing your car to make it rain doesn't
work.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment