<div dir="ltr">In the previous email, I transcribed wrongly the qml keys example. The correct example is:<div><div style="font-size:13px"><br></div><div style="font-size:13px">    TextArea {</div><div style="font-size:13px">       id: textArea</div><div style="font-size:13px">       EnterKey.onClicked: console.log("EnterKey.onClicked")</div><div style="font-size:13px">       Keys.onEnterPressed: console.log("Keys.onEnterPressed")<br></div><div style="font-size:13px">       Keys.onPressed: console.log("Keys.onPressed")<br></div><div style="font-size:13px">    }</div></div><div style="font-size:13px"><br></div><div style="font-size:13px">(I forgot to put the 's' in "Keys", anyways, it doesn't work, signals are not fired)</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-05 20:11 GMT-03:00 Nicolas Cisco <span dir="ltr"><<a href="mailto:ncis20@gmail.com" target="_blank">ncis20@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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><span class="HOEnZb"><font color="#888888"><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></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Nicolas Cisco<br><a href="http://www.nckweb.com.ar" target="_blank">www.nckweb.com.ar</a><br></div>
</div>