slang-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] keystring conversion to non UTF-8 string?


Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
>> The SLang_process_keystring converts ^X to an unsigned byte value using
>> the algorithm
>>
>>    (unsigned char) (X - 'A' + 1)
>>
>> This mechanism works for valid control characters ^A-^Z as well as ^@,
>> ^[, ^\, ^], ^^, and ^_.
>
>Can you check for this range, e.g. >= '@' and <= '_'? And outside of this
>range do nothing or throw an error. How else can I give the key sequence
>"^X ^ /"?

Unfortunately, there is no "escape" mechanism for using '^' in a
key-sequence except as the last character.  However, you can exploit
the algorithm to achieve the desired result.  In particular, the
key-sequence ^X ^ / may be represented by the string "^X^\x9E/", since
'^' = 0x9E-'A'+1.

--John


_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]