<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 5:21 PM, Manuel Quiñones <span dir="ltr"><<a href="mailto:manuq@laptop.org" target="_blank">manuq@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The latest is the one, sorry for the mistake.<br>
<br>
/me thinks this proccess is too error-prone.<br>
<br>
2012/5/10 Manuel Quiñones <<a href="mailto:manuq@laptop.org">manuq@laptop.org</a>>:<br>
<div class="HOEnZb"><div class="h5">> Used the same approach than the solution for the Escape<br>
> capture when the activity is fullscreen mode. Refactored the<br>
> method to allow this keystrokes.<br>
><br>
> This fixes <a href="http://dev.laptop.org/ticket/11836" target="_blank">http://dev.laptop.org/ticket/11836</a> and<br>
> <a href="http://bugs.sugarlabs.org/ticket/3222" target="_blank">http://bugs.sugarlabs.org/ticket/3222</a> .<br>
><br>
> Signed-off-by: Manuel Quiñones <<a href="mailto:manuq@laptop.org">manuq@laptop.org</a>><br>
> Reviewed-by: James Cameron <<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>><br>
> Tested-by: James Cameron <<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>><br>
> ---<br>
> terminal.py | 23 +++++++++++++++++++----<br>
> 1 files changed, 19 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/terminal.py b/terminal.py<br>
> index 6de7500..ee46fdc 100644<br>
> --- a/terminal.py<br>
> +++ b/terminal.py<br>
> @@ -380,15 +380,30 @@ class TerminalActivity(activity.Activity):<br>
> vt.fork_command("/bin/su", ('/bin/su', '-'))<br>
><br>
> def __key_press_cb(self, window, event):<br>
> - # Escape keypresses are routed directly to the vte and then dropped.<br>
> - # This hack prevents Sugar from hijacking them and canceling<br>
> - # fullscreen mode.<br>
> - if gtk.gdk.keyval_name(event.keyval) == 'Escape':<br>
> + """Route some keypresses directly to the vte and then drop them.<br>
> +<br>
> + This prevents Sugar from hijacking events that are useful in<br>
> + the vte.<br>
> +<br>
> + """<br>
> +<br>
> + def event_to_vt(event):<br>
> current_page = self._notebook.get_current_page()<br>
> vt = self._notebook.get_nth_page(current_page).vt<br>
> vt.event(event)<br>
> +<br>
> + key_name = gtk.gdk.keyval_name(event.keyval)<br>
> +<br>
> + # Escape is used in Sugar to cancel fullscreen mode.<br>
> + if key_name == 'Escape':<br>
> + event_to_vt(event)<br>
> return True<br>
><br>
> + elif event.get_state() & gtk.gdk.CONTROL_MASK:<br>
> + if key_name in ['z', 'q']:<br>
> + event_to_vt(event)<br>
> + return True<br>
> +<br>
> return False<br>
><br>
> def read_file(self, file_path):<br>
> --<br>
> 1.7.7.6<br>
><br>
<br>
<br>
<br></div></div></blockquote><div><br></div><div>Applied as</div><div><br></div><div> <a href="http://git.sugarlabs.org/terminal/mainline/commit/ffd25f6841295a956d7fab921e49cbbd99f820ec">http://git.sugarlabs.org/terminal/mainline/commit/ffd25f6841295a956d7fab921e49cbbd99f820ec</a></div>
<div><br></div><div>Should be in next version.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
</div></div><span class="HOEnZb"><font color="#888888">--<br>
.. manuq ..<br>
</font></span></blockquote></div><br>