screenshot-ui: Bind Ctrl-C, Enter, Space to capture

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
This commit is contained in:
Ivan Molodetskikh 2021-08-16 14:30:44 +03:00 committed by Marge Bot
parent 6f42eaf17d
commit e12689108a

View File

@ -362,6 +362,18 @@ class ScreenshotUI extends St.Widget {
this.close(); this.close();
} }
vfunc_key_press_event(event) {
const symbol = event.keyval;
if (symbol === Clutter.KEY_Return || symbol === Clutter.KEY_space ||
((event.modifier_state & Clutter.ModifierType.CONTROL_MASK) &&
(symbol === Clutter.KEY_c || symbol === Clutter.KEY_C))) {
this._onCaptureButtonClicked();
return Clutter.EVENT_STOP;
}
return super.vfunc_key_press_event(event);
}
}); });
/** /**