<br><br><div class="gmail_quote">On Mon, Nov 2, 2009 at 12:04 AM, Fernando Vilas <span dir="ltr">&lt;<a href="mailto:fvilas@iname.com">fvilas@iname.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Sunday 01 November 2009 20:16:06 Alvaro Soliverez wrote:<br>
&gt; Hello all,<br>
&gt; I found why that is.<br>
&gt;<br>
&gt; During the port, the KeyButtonMask, which is used to check when a key is<br>
&gt; part of the modifiers (Alt, Shift, etc) was ported to KeyboardModifierMask.<br>
&gt; Unfortunately, that mask now contains the KeypadModifier, which informs<br>
&gt; whether a keypad key was pressed.<br>
&gt; That results in this piece of code in transactioneditor never returning<br>
&gt;  true when the keypad Enter is pressed:<br>
&gt;<br>
&gt; line 164:<br>
&gt;<br>
&gt; if(o-&gt;isWidgetType()<br>
&gt;<br>
&gt; &amp;&amp; (e-&gt;type() == QEvent::KeyPress)<br>
&gt;<br>
&gt; &amp;&amp; m_editWidgets.values().contains(dynamic_cast&lt;QWidget*&gt;(o))) {<br>
&gt;<br>
&gt; QKeyEvent* k = dynamic_cast&lt;QKeyEvent*&gt;(e);<br>
&gt;<br>
&gt; if((k-&gt;modifiers() &amp; Qt::KeyboardModifierMask) == 0) {<br>
&gt;<br>
&gt;<br>
&gt; I tried this and it works, but I want to check if there is a nicer way:<br>
&gt;<br>
&gt;  if((k-&gt;modifiers() &amp; Qt::KeyboardModifierMask) == 0<br>
&gt;<br>
&gt; || (k-&gt;modifiers() &amp; Qt::KeypadModifier) != 0) {<br>
&gt;<br>
<br>
</div></div>It looks like you could get away with only using the check for<br>
Qt::KeypadModifier. The Qt docs don&#39;t mention the other one, so I have to<br>
assume it was left over from Qt3, where one had to filter based on keyboard or<br>
mouse inputs. When they changed from k-&gt;state() to k-&gt;modifiers(), I think that<br>
went away.<br>
<font color="#888888"></font><br></blockquote></div><br>Not really, because you want to enter that loop if a key was entered, as long as it is not an ordinary modifier (Alt, Shift, etc.). <br>If there is a mask that includes modifiers but excludes the keypad modifier, that&#39;s what we should use. <br>