Let focus escape composer web view using Ctrl+Tab/Ctrl+Shift+Tab.

* src/client/composer/composer-widget.vala: Let default keyboard
  shortcuts handle focus move.

* ui/composer-web-view.js: Don't consume Tab presses with Crtl/Alt/Meta
  modifiers.
This commit is contained in:
Michael James Gratton 2017-01-25 17:14:13 +11:00
parent dec06d93be
commit 48d92fa67c
2 changed files with 8 additions and 16 deletions

View file

@ -2010,23 +2010,9 @@ public class ComposerWidget : Gtk.EventBox {
return Gdk.EVENT_STOP;
}
if ((event.state & Gdk.ModifierType.MOD1_MASK) != 0)
return Gdk.EVENT_PROPAGATE;
if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0) {
if (event.keyval == Gdk.Key.Tab) {
child_focus(Gtk.DirectionType.TAB_FORWARD);
return Gdk.EVENT_STOP;
}
if (event.keyval == Gdk.Key.ISO_Left_Tab) {
child_focus(Gtk.DirectionType.TAB_BACKWARD);
return Gdk.EVENT_STOP;
}
return Gdk.EVENT_PROPAGATE;
}
if (this.can_delete_quote) {
this.can_delete_quote = false;
if (event.keyval == Gdk.Key.BackSpace) {
if (event.is_modifier == 0 && event.keyval == Gdk.Key.BackSpace) {
this.editor.delete_quoted_message();
return Gdk.EVENT_STOP;
}

View file

@ -53,7 +53,13 @@ ComposerPageState.prototype = {
this.messageBody = document.getElementById(ComposerPageState.BODY_ID);
this.messageBody.addEventListener("keydown", function(e) {
if (e.keyCode == 9) {
// Should be using 'e.key == "Tab"' here, but that was
// only fixed in WK in Oct 2016 (WK Bug 36267). Migrate to
// that when we can rely on it being in WebKitGTK.
if (e.keyIdentifier == "U+0009"
&& !e.ctrlKey
&& !e.altKey
&& !e.metaKey) {
if (!e.shiftKey) {
state.tabOut();
} else {