<div class="gmail_quote">On Tue, Sep 28, 2010 at 10:53 PM, Ray Strode <span dir="ltr">&lt;<a href="mailto:halfline@gmail.com">halfline@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<div class="im"><br>
<br>
&gt; Yeah the \123 is more standard.<br>
</div>Note C supports \123 for octal and \x123 for hex.<br>
python uses \u1234 for unicode codepoints.<br></blockquote><div><br></div><div>The first two are trivial to do with string.h, as for the third I do not know. I say let&#39;s support all three, but honestly I never saw anyone use the hex ascii representation in the last 20 years...</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt; Although now I am thinking all of this<br>
&gt; should be unicode characters and have a unique character for each key stroke<br>
&gt; (ctrl-V, esc, etc).<br>
</div>that works for control characters (and sort of what we have now) but<br>
not for escape sequences. There&#39;s not unicode codepoint for &quot;user hit<br>
the up arrow key&quot;<br></blockquote><div> </div><div>Right.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I don&#39;t really think it should be inline with the user&#39;s typed keys,<br>
honestly.  We should filter it out at the plymouth daemon level, and<br>
send it to the plugin out-of-band using a different call back.<br></blockquote><div> </div><div>Well, that idea is fine too, but I suggest, as normal chars are, well ... single chars, that if you do some preprocessing the raw chars are passed as single chars to the callback, and special ones (ANSI sequences) as multi-chars strings, like &quot;UP&quot;, &quot;DOWN&quot; in cooked mode, using the same callback (I cannot see any reason to use a different one there). The only problem is that you get some control out of the users hands by doing that. Unless you do a blend of both, cooking escape sequences at plymouth C code level, and sending a generic string to the callback to signify that, without needing to implement a large case statement in the C code. Instead of &quot;UP&quot;, you would get the actual ESC char + [ + A (allowing &quot;if (key == &quot;\033[A&quot;) {...} ). _I_ would prefer that last solution. It would mean just decide the duration of a &quot;compose delay&quot;, and every chars arriving at less than this interval are just grouped together and sent to the script. Easy, robust and unobtrusive while being powerfulland solving all escape sequence issues. However, a String.Len might come in handy to handle that ;-)</div>
<div><br></div></div>-- <br>Jérôme Martin<br>