Hi again,<div><br></div><div>As promised I experimented a bit on my side....</div><div><br></div><div>1) I upgraded to git version, still no luck with the keyboard messup with init (from sysvinit debian squeeze) when it starts the rc2.d after rcS execution.</div>
<div><br></div><div>2) I experimented with getting the arrow keys working:</div><div><br></div><div> - Disabled the key capture in main.c. What I have in mind is to replace that by additional hooks in the script file, with proper SetXXXCallback functions to restore the details view, etc.</div>
<div> - Added some logic in the scan code to understand c-like "\XXX" where XXX is an octal number. I had to disabled the simple '\0' case for that (the logic of the scan code is not very kin to supporting both, so I got lazy, but that could be implemented too), so with my patches you need to use "\000" instead. Just for fun I also added a XOR method to the script String object, so you can use things like "\100".XOR("[") in a script.</div>
<div><br></div><div>3) On the script side, the logic to properly get ANSI escape sequences while still being able to capture single escape characters or single '[' normally looks like the following. Here the up and down keys trigger scrolling my log viewer...</div>
<div><br></div><div><div>fun refresh_callback () {</div><div> # Animate our icons</div><div> [..]</div><div><br></div><div> # Keyboard mod delays decrement</div><div> if (escape_mod_delay > 0) {</div><div> escape_mod_delay--;</div>
<div> if (escape_mod_delay == 0) {</div><div> inkey_callback("ESC");</div><div> }</div><div> }</div><div> if (ansi_mod_delay > 0) { ansi_mod_delay--; }</div><div>}</div></div><div><br></div><div>
<br></div><div><div># Allows parts of an escape sequence to arrive at 1/25th second interval</div><div>compose_keys_delay = 2;</div><div>escape_mod_delay = 0;</div><div>ansi_mod_delay = 0;</div></div><div><br></div><div><div>
fun inkey_callback (key) {</div><div> if (key == "ESC") {</div><div> key = "\033";</div><div> # The following "\033" could be written "\100".XOR("[")</div><div> } else if (key == "\033" && escape_mod_delay == 0) {</div>
<div> escape_mod_delay = compose_keys_delay;</div><div> key = "";</div><div> } else if (key == "[" && escape_mod_delay > 0) {</div><div> ansi_mod_delay = compose_keys_delay;</div>
<div> escape_mod_delay = 0;</div><div> key = "";</div><div> } else if (ansi_mod_delay > 0) {</div><div> if (key == "A") {</div><div> key = "UP";</div><div> } else if (key == "B") {</div>
<div> key = "DOWN";</div><div> } else if (key == "C") {</div><div> key = "LEFT";</div><div> } else if (key == "D") {</div><div> key = "RIGHT";</div><div>
}</div><div> ansi_mod_delay = 0;</div><div> }</div><div><br></div><div> if (key == "UP") {</div><div> if (log_view_pos == -1) {</div><div> log_view_pos = log_len - display_len;</div><div> }</div>
<div> log_view_pos--;</div><div> if (log_view_pos < 1)</div><div> log_view_pos = 0;</div><div> display_log();</div><div> } else if (key == "DOWN") {</div><div> if (log_view_pos != -1) {</div>
<div> log_view_pos++;</div><div> if (log_view_pos > log_len - display_len) {</div><div> log_view_pos = -1;</div><div> } else {</div><div> display_log();</div><div> }</div><div> }</div>
<div> } else if (key != "") {</div><div> toggle_help();</div><div> }</div><div>}</div></div><div><br></div><div>And the patches themselves in attached file...</div><div><br></div><div>4) About my questions on string handling, I think I am now familiar enough with plymouth script parser to implement what I need myself. I noticed SubString() and a CharAt() methods already, I will probably add a Len() one for my needs. I was also going to ask a question about fonts, but it seems that the Image.Text() has already been augmented to handle font selection, so I am all set there :-) the current git version certainly deserves a proper release and some documentation though ...</div>
<div><br></div><div>5) As a sidenote, I did a quick debian packaging of the git version, but had to adapt a bit the debian package rules from squeeze because it assumed that plymouth original sources already had autoconf ran there, when those that I downloaded had an autogen.sh script ... This is weird, and it is either an unclean package in debian OR the fact that you released last time with autogen.sh already ran. Is that the case ?</div>
<div><br></div><div>Best Regards,</div><div>-- <br>Jérôme Martin<br>
</div>