diff --git a/area.js b/area.js
index 5fcbddb..380da2f 100644
--- a/area.js
+++ b/area.js
@@ -802,8 +802,8 @@ var DrawingArea = new Lang.Class({
this.currentElement.text = '';
this.currentElement.cursorPosition = 0;
// Translators: %s is a key label
- this.emit('show-osd', Files.Icons.TOOL_TEXT, _("Type your text and press %s")
- .format(Gtk.accelerator_get_label(Clutter.KEY_Escape, 0)), "", -1, true);
+ this.emit('show-osd', Files.Icons.TOOL_TEXT, _("Press %s\nto start a new line")
+ .format(Gtk.accelerator_get_label(Clutter.KEY_Return, 1)), "", -1, true);
this._updateTextCursorTimeout();
this.textHasCursor = true;
this._redisplay();
@@ -828,9 +828,7 @@ var DrawingArea = new Lang.Class({
}
this.textEntry.clutterText.connect('activate', (clutterText) => {
- let startNewLine = true;
- this._stopWriting(startNewLine);
- clutterText.text = "";
+ this._stopWriting();
});
this.textEntry.clutterText.connect('text-changed', (clutterText) => {
@@ -844,8 +842,16 @@ var DrawingArea = new Lang.Class({
this.textEntry.clutterText.connect('key-press-event', (clutterText, event) => {
if (event.get_key_symbol() == Clutter.KEY_Escape) {
+ this.currentElement.text = "";
this._stopWriting();
return Clutter.EVENT_STOP;
+ } else if (event.has_shift_modifier() &&
+ (event.get_key_symbol() == Clutter.KEY_Return ||
+ event.get_key_symbol() == Clutter.KEY_KP_Enter)) {
+ let startNewLine = true;
+ this._stopWriting(startNewLine);
+ clutterText.text = "";
+ return Clutter.EVENT_STOP;
}
// 'cursor-changed' signal is not emitted if the text entry is not visible.
diff --git a/locale/draw-on-your-screen.pot b/locale/draw-on-your-screen.pot
index 5e87946..5de5eaf 100644
--- a/locale/draw-on-your-screen.pot
+++ b/locale/draw-on-your-screen.pot
@@ -44,7 +44,7 @@ msgstr ""
#. Translators: %s is a key label
#, javascript-format
-msgid "Type your text and press %s"
+msgid "Press %s\nto start a new line"
msgstr ""
#. Translators: It is displayed in an OSD notification to ask the user to start picking, so it should use the imperative mood.