hide help on `Escape` key pressed

Press the key again to leave drawing mode.
This commit is contained in:
abakkk 2020-06-05 22:52:02 +02:00
parent 0249d12694
commit c087e359d9
1 changed files with 4 additions and 1 deletions

View File

@ -297,6 +297,9 @@ var DrawingArea = new Lang.Class({
_onKeyPressed: function(actor, event) { _onKeyPressed: function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Escape) { if (event.get_key_symbol() == Clutter.KEY_Escape) {
if (this.helper.visible)
this.helper.hideHelp();
else
this.emit('stop-drawing'); this.emit('stop-drawing');
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;