<div dir="ltr">Hi,<div>I'm using the EnterKey.onClicked in a TextArea, the problem is that if I retrieve the text area's text in the callback function, it has a trailing newline (the enter input). Is there a way to prevent the enter key?. I though of striping the enterkey by hand in the callback like `textArea.text = textArea.text.slice(0, -1)`, but, the problem is that if you are not in the end of the input this doesn't work.</div><div><br></div><div>The example is simple:</div><div><br></div><div>    TextArea {</div><div>       id: textArea</div><div>       EnterKey.onClicked: console.log("my text is: \""+textArea.text+"\"")</div><div>    }</div><div><br></div><div>I tried to see if the event works (as the QML Keys Element [ <a href="http://doc.qt.io/qt-5/qml-qtquick-keys.html">http://doc.qt.io/qt-5/qml-qtquick-keys.html</a> ] ), but it doesn't.</div><div><br></div><div>I try using the qml Keys api:</div><div><br></div><div><div>    TextArea {</div><div>       id: textArea</div><div>       EnterKey.onClicked: console.log("EnterKey.onClicked")</div><div>       Key.onEnterPressed: console.log("Key.onEnterPressed")<br></div><div>       Key.onPressed: console.log("Key.onPressed")<br></div><div>    }</div></div><div><br></div><div>But doesn't work, the only signal fired is EnterKey.onClicked.</div><div><br></div><div>In addition, my idea is to allow the user to input enters by using shift and then the enter key, is there a way in order to achieve this?.</div><div><br></div><div><span style="font-size:13px">Any help is appreciated! =)</span><br></div><div><span style="font-size:13px">Thanks in advance!</span></div><div><div><br></div>-- <br><div>Nicolas Cisco<br><a href="http://www.nckweb.com.ar" target="_blank">www.nckweb.com.ar</a><br></div>
</div></div>