Eric Arnold wrote:
> The doc page really only talks about regular control chars, leaving
> the problem of special keys to the imagination. Are they to be
> considered a string of characters which are to be evaluated
> individually against 'isprint', or are they a meta-character which is
> to be evaluated against 'isprint'?
>
>
> strtrans({expr}) *strtrans()*
> The result is a String, which is {expr} with all unprintable
> characters translated into printable characters |'isprint'|.
> Like they are shown in a window. Example: >
> echo strtrans(@a)
> < This displays a newline in register a as "^@" instead of
> starting a new line
>
>
> However, if you have a <s-leftmouse>, then having
>
> ü=02ý,
>
> show up in your window doesn't seem to be in the spirit of "all
> unprintable characters translated". Yes, the individual components of
> the string are in the @,~-255 range, but the key represented (left
> mouse) is not.
The function does not have the purpose of showing key codes. It is
really only to turn a string into something without non-printable
characters. That's it.
The byte sequences used for a special character may also appear in a
file or in a file name, they must not be interpreted as a special key
then.
If you really want to convert a byte sequence to special key names
another function would need to be used.
--
hundred-and-one symptoms of being an internet addict:
129. You cancel your newspaper subscription.
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///