[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: fix bug: not working mouse middle and right click
From:       "Cyrille Berger" <cberger () cberger ! net>
Date:       2010-09-30 11:08:19
Message-ID: 20100930110819.12662.59439 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 2010-09-29 16:18:47, Thomas Zander wrote:
> > I'm not entire sure I follow the logic; tablet events have many more op=
tions than just left/right (/middle) button, they have two enums for this o=
n the tablet event.
> > =

> > But, not following the logic I'm going to take a look at the diff and n=
otice a logic issue; the the events should first be offered to the tool and=
 the tool can decide if it wants to accept it. Your code at the top decides=
 to ignore the event and as such it will never be sent to the tool.
> > Deciding to never send it to the tool will probably make various tools =
be disappointed.
> > =

> > Also it should be noted that there is no one to one relation for tablet=
 and mouse events.  A unloaded system gets between 2 and 10 times as many t=
ablet events as mouse events. Ignoring the tablet event will make data get =
lost.
> =

> Adam wrote:
>     Yes, they have more options, but i didn't find a right/middle button =
option. the documentation says, that there is one enum for device and one f=
or pointer type. there is no enum for the button, at least i didn't find on=
e. if there is, then please tell me the method name and i will admit, that =
i'm very stupid.
>     =

>     if you are so kind as to go to the diff, then please also be so kind =
and look at the comments or at qt documentation. the documentation states, =
that it will be resent as a qmouseevent, here is the link: http://doc.troll=
tech.com/4.6/qtabletevent.html#details By the way, if you think, that the t=
ools don't get the event with my change, then explain, how it would be poss=
ible, that panning has started to work.
>     =

>
> =

> Thomas Zander wrote:
>     > Yes, they have more options, but i didn't find a right/middle button
>     > option. the documentation says, that there is one enum for device a=
nd one
>     > for pointer type. there is no enum for the button, =

>     =

>     Looking at my tablet I have no left or right buttons, the pen as a fr=
ont and a back, the airbrush a button that changes flow etc.
>     But no buttons that would make sense from an API persective to call '=
left' or 'right'.
>     You are right about the API missing it. I agree there. And this ties =
in with my previous post that said that I don't follow the logic in your de=
scription; what you are saying is that you want to know about the right mou=
se button. But there is no right mouse button on most tablet hardware.
>     =

>     > if you are so kind as to go to the diff, then please also be so kin=
d and
>     > look at the comments or at qt documentation. the documentation stat=
es,
>     > that it will be resent as a qmouseevent, here is the link:
>     > http://doc.trolltech.com/4.6/qtabletevent.html#details =

>     =

>     I have spent some time on the X11 handling code for the tablet events=
. I'm sure I'm not an expert, but at least I have a little bit an understan=
ding of it. Greater minds are available here too, so maybe you can can expl=
ain what it is that you wanted me to find in the docs? The point of there b=
eing more tablet events than mouse events is probably not in the docs. You =
think it has to be?
>     =

>     > By the way, if you
>     > think, that the tools don't get the event with my change, then expl=
ain,
>     > how it would be possible, that panning has started to work.
>     =

>     I didn't mean to imply that the tools don't get any events at all. So=
rry if I was unclear. My thinking was that you are throwing away specific e=
vents based on a certain filter and *those* events the tool no longer gets.
>     Which means you are loosing information and that makes this probably =
not the best solution to the problem you are having.
>     =

>     I'm still not sure what the actual problem *is* you are having. I'm c=
oncluding the point of finding out weather the user pressed with the right =
mouse button while holding a tablet-pen is a symptom in a bigger problem. M=
aybe you can explain it so we can find a solution together?
>     =

>     If panning now works, maybe the tool didn't properly handle tablet ev=
ents but did accept them. I can't tell without investigating further.

If you look at http://www.carbodydesign.com/archive/2009/04/03-wacom-intuos=
4/Wacom-Intuos4-Grip-Pen-lg.jpg you can see a button on the pen, this is th=
is button we want to use. Usually, without tablet support, this button is m=
apped to middle- and right- button, while just pressing trigger a left- cli=
ck event (you can try yourself, if you use the tablet in plasma, for instan=
ce). Wether you call those modifiers middle-, right- , or modifier-1 and mo=
difier-2 does not matter :) All it matters is that we can use them in krita.

As for the number of events, there are more tablet events than mouse events=
 for the simple reason that a tablet generates much more events than a mous=
e, mostly because of higher accuracy. I don't remember seeing any code in Q=
t that reduce the number of tablet events when they are redirected to mouse=
 events (which is confirmed by the number of mouse events we receive in col=
or selectors widgets when used with a tablet, or shown by this application =
http://cyrille.diwi.org/tmp/krita/tablet.tar.bz2).


- Cyrille


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5478/#review7881
-----------------------------------------------------------


On 2010-09-29 15:35:42, Adam wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5478/
> -----------------------------------------------------------
> =

> (Updated 2010-09-29 15:35:42)
> =

> =

> Review request for KOffice.
> =

> =

> Summary
> -------
> =

> QTabletEvent has no information about which button was pressed on the sty=
lus. We have to reject it, so that it gets resent as a QMouseEvent with the=
 correct buttons.
> =

> =

> Diffs
> -----
> =

>   /trunk/koffice/libs/flake/KoToolProxy.cpp 1180634 =

> =

> Diff: http://svn.reviewboard.kde.org/r/5478/diff
> =

> =

> Testing
> -------
> =

> panning and popup palette in krita works now.
> =

> =

> Thanks,
> =

> Adam
> =

>


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/5478/">http://svn.reviewboard.kde.org/r/5478/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On September 29th, 2010, 4:18 p.m., <b>Thomas \
Zander</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I&#39;m not entire sure I follow the logic; tablet events have many more \
options than just left/right (/middle) button, they have two enums for this on the \
tablet event.

But, not following the logic I&#39;m going to take a look at the diff and notice a \
logic issue; the the events should first be offered to the tool and the tool can \
decide if it wants to accept it. Your code at the top decides to ignore the event and \
as such it will never be sent to the tool. Deciding to never send it to the tool will \
probably make various tools be disappointed.

Also it should be noted that there is no one to one relation for tablet and mouse \
events.  A unloaded system gets between 2 and 10 times as many tablet events as mouse \
events. Ignoring the tablet event will make data get lost.</pre>  </blockquote>




 <p>On September 29th, 2010, 4:51 p.m., <b>Adam</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes, they have more \
options, but i didn&#39;t find a right/middle button option. the documentation says, \
that there is one enum for device and one for pointer type. there is no enum for the \
button, at least i didn&#39;t find one. if there is, then please tell me the method \
name and i will admit, that i&#39;m very stupid.

if you are so kind as to go to the diff, then please also be so kind and look at the \
comments or at qt documentation. the documentation states, that it will be resent as \
a qmouseevent, here is the link: \
http://doc.trolltech.com/4.6/qtabletevent.html#details By the way, if you think, that \
the tools don&#39;t get the event with my change, then explain, how it would be \
possible, that panning has started to work.

</pre>
 </blockquote>





 <p>On September 30th, 2010, 10:30 a.m., <b>Thomas Zander</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; Yes, they have more \
options, but i didn&#39;t find a right/middle button &gt; option. the documentation \
says, that there is one enum for device and one &gt; for pointer type. there is no \
enum for the button, 

Looking at my tablet I have no left or right buttons, the pen as a front and a back, \
the airbrush a button that changes flow etc. But no buttons that would make sense \
from an API persective to call &#39;left&#39; or &#39;right&#39;. You are right about \
the API missing it. I agree there. And this ties in with my previous post that said \
that I don&#39;t follow the logic in your description; what you are saying is that \
you want to know about the right mouse button. But there is no right mouse button on \
most tablet hardware.

&gt; if you are so kind as to go to the diff, then please also be so kind and
&gt; look at the comments or at qt documentation. the documentation states,
&gt; that it will be resent as a qmouseevent, here is the link:
&gt; http://doc.trolltech.com/4.6/qtabletevent.html#details 

I have spent some time on the X11 handling code for the tablet events. I&#39;m sure \
I&#39;m not an expert, but at least I have a little bit an understanding of it. \
Greater minds are available here too, so maybe you can can explain what it is that \
you wanted me to find in the docs? The point of there being more tablet events than \
mouse events is probably not in the docs. You think it has to be?

&gt; By the way, if you
&gt; think, that the tools don&#39;t get the event with my change, then explain,
&gt; how it would be possible, that panning has started to work.

I didn&#39;t mean to imply that the tools don&#39;t get any events at all. Sorry if I \
was unclear. My thinking was that you are throwing away specific events based on a \
certain filter and *those* events the tool no longer gets. Which means you are \
loosing information and that makes this probably not the best solution to the problem \
you are having.

I&#39;m still not sure what the actual problem *is* you are having. I&#39;m \
concluding the point of finding out weather the user pressed with the right mouse \
button while holding a tablet-pen is a symptom in a bigger problem. Maybe you can \
explain it so we can find a solution together?

If panning now works, maybe the tool didn&#39;t properly handle tablet events but did \
accept them. I can&#39;t tell without investigating further.</pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">If you look at \
http://www.carbodydesign.com/archive/2009/04/03-wacom-intuos4/Wacom-Intuos4-Grip-Pen-lg.jpg \
you can see a button on the pen, this is this button we want to use. Usually, without \
tablet support, this button is mapped to middle- and right- button, while just \
pressing trigger a left- click event (you can try yourself, if you use the tablet in \
plasma, for instance). Wether you call those modifiers middle-, right- , or \
modifier-1 and modifier-2 does not matter :) All it matters is that we can use them \
in krita.

As for the number of events, there are more tablet events than mouse events for the \
simple reason that a tablet generates much more events than a mouse, mostly because \
of higher accuracy. I don&#39;t remember seeing any code in Qt that reduce the number \
of tablet events when they are redirected to mouse events (which is confirmed by the \
number of mouse events we receive in color selectors widgets when used with a tablet, \
or shown by this application http://cyrille.diwi.org/tmp/krita/tablet.tar.bz2).</pre> \
<br />








<p>- Cyrille</p>


<br />
<p>On September 29th, 2010, 3:35 p.m., Adam wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KOffice.</div>
<div>By Adam.</div>


<p style="color: grey;"><i>Updated 2010-09-29 15:35:42</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">QTabletEvent has no information about which button was pressed on the \
stylus. We have to reject it, so that it gets resent as a QMouseEvent with the \
correct buttons.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">panning and popup palette in krita works now.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/koffice/libs/flake/KoToolProxy.cpp <span style="color: \
grey">(1180634)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/5478/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic