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

List:       freedesktop-xorg
Subject:    Re: eGalax touchscreen and RandR rotation
From:       Sandeep <sandy.8925 () gmail ! com>
Date:       2013-10-22 17:30:16
Message-ID: CAGPDPzCd=HDDBazjytX-=gKrbmxKQEeBkiNV-i6oQUBXiS71rg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Here's touch calculations taken from Android documentation on Linux touch
input:

xScale = output.width / raw.width
yScale = output.height / raw.height

If not orientation aware or screen rotation is 0 degrees:
output.x = (raw.x - raw.x.min) * xScale
output.y = (raw.y - raw.y.min) * yScale
Else If rotation is 90 degrees:
    output.x = (raw.y - raw.y.min) * yScale
    output.y = (raw.x.max - raw.x) * xScale
Else If rotation is 180 degrees:
    output.x = (raw.x.max - raw.x) * xScale
    output.y = (raw.y.max - raw.y) * yScale
Else If rotation is 270 degrees:
    output.x = (raw.y.max - raw.y) * yScale
    output.y = (raw.x - raw.x.min) * xScale
End If


These are taken from this page:
https://source.android.com/devices/tech/input/touch-devices.html

The problem might be that X is not calculating the correct cursor positions
when the screen is rotated using xrandr

-Sandeep


On Mon, Oct 21, 2013 at 2:59 PM, Sandeep <sandy.8925@gmail.com> wrote:

> For input, I am using xf86-input-evdev . I am not using the proprietary
> eGalax driver. I might be wrong about the input rotating with the screen.
>
> The problem is the mouse cursor/pointer location does not correspond to
> the touch input. The movement of the cursor does correspond to the touch
> input, but seems to be rotated the same way the screen has been rotated.
>
> For example, assume a 11 inch display with a resolution of 1280*800 . The
> default orientation is the upright landscape orientation. I use the KDE
> screen rotation utility (krandrtray) to rotate the screen left by 90
> degrees(portrait). When I touch near the top left corner (in the upright
> landscape orientation), the mouse cursor jumps to a corresponding position
> near the top left corner in portrait mode.
>
> So, there is a definite pattern connecting the touch input position and
> the mouse cursor position - it looks like the input position is rotated the
> same way display was rotated.
>
> If I use the coordinate transformation matrix in the script here:
> https://wiki.archlinux.org/index.php/Multitouch_Displays#Rotating_the_touch_screen
>             (see "Rotating the touch screen" section)
>
> It works correctly - the mouse cursor follows the touch input.
>
> Also, this problem is not specific to KDE, but also GNOME and even the
> Fluxbox window manager.
>
> -Sandeep
>
>
>
>
>
>
> On Mon, Oct 21, 2013 at 2:41 PM, Peter Hutterer <peter.hutterer@who-t.net>wrote:
>
>> On Fri, Oct 04, 2013 at 05:36:00PM -0700, Sandeep wrote:
>> > Hi,
>> >
>> > I have an Acer Iconia Tab W500. It has an eGalax touchscreen. Single
>> touch
>> > input  works.
>> >
>> > I mainly use KDE, and when I rotate the screen using the Krandrtray
>> > application, the mouse input works fine, but the touchscreen input does
>> not
>> > work correctly.
>> >
>> > Here is a video showing the problem:
>> > http://www.youtube.com/watch?v=OviHJmjhoOI
>> >
>> > It looks like the touch driver rotates the input in the same way that
>> the
>> > screen is rotated, thus producing wrong/unexpected behaviour.
>> >
>> > I tried searching for existing bugs at bugs.freedesktop.org and it
>> doesn't
>> > look like any of them cover this problem. Does anyone know what the
>> problem
>> > might be, and how I can figure out where the problem lies?
>>
>> what driver are you using? no X driver currently rotates with the screen,
>> it's something that needs to be triggered from the outside so chances are
>> that whatever triggers the rotation in KDE is triggering the wrong thing.
>>
>> Cheers,
>>    Peter
>>
>
>

[Attachment #5 (text/html)]

<div dir="ltr">Here&#39;s touch calculations taken from Android documentation on \
Linux touch input:<div><br></div><div><pre class="" \
style="font-size:13px;margin-top:0px;color:rgb(0,102,0);line-height:19px;padding:1em;overflow:auto;border:1px \
solid rgb(221,221,221);background-color:rgb(247,247,247)"> <code \
style="line-height:14px"><span class="" style="color:rgb(0,0,0)">xScale </span><span \
class="" style="color:rgb(102,102,0)">=</span><span class="" \
style="color:rgb(0,0,0)"> output</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">width \
</span><span class="" style="color:rgb(102,102,0)">/</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">width<br> yScale </span><span class="" \
style="color:rgb(102,102,0)">=</span><span class="" style="color:rgb(0,0,0)"> \
output</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">height </span><span class="" \
style="color:rgb(102,102,0)">/</span><span class="" style="color:rgb(0,0,0)"> \
raw</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">height<br> <br></span><span class="" \
style="color:rgb(102,0,102)">If</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(0,0,136)">not</span><span class="" \
style="color:rgb(0,0,0)"> orientation aware </span><span class="" \
style="color:rgb(0,0,136)">or</span><span class="" style="color:rgb(0,0,0)"> screen \
rotation </span><span class="" style="color:rgb(0,0,136)">is</span><span class="" \
style="color:rgb(0,0,0)"> </span><span class="" \
style="color:rgb(0,102,102)">0</span><span class="" style="color:rgb(0,0,0)"> \
degrees</span><span class="" style="color:rgb(102,102,0)">:</span><span class="" \
style="color:rgb(0,0,0)"><br> output</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">x \
</span><span class="" style="color:rgb(102,102,0)">=</span><span class="" \
style="color:rgb(0,0,0)"> </span><span class="" \
style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">x \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">min</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> xScale<br> output</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">y \
</span><span class="" style="color:rgb(102,102,0)">=</span><span class="" \
style="color:rgb(0,0,0)"> </span><span class="" \
style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">y \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">y</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">min</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> yScale<br> </span><span class="" \
style="color:rgb(102,0,102)">Else</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,0,102)">If</span><span class="" \
style="color:rgb(0,0,0)"> rotation </span><span class="" \
style="color:rgb(0,0,136)">is</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(0,102,102)">90</span><span class="" \
style="color:rgb(0,0,0)"> degrees</span><span class="" \
style="color:rgb(102,102,0)">:</span><span class="" style="color:rgb(0,0,0)"><br>  \
output</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x </span><span class="" \
style="color:rgb(102,102,0)">=</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">y \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">y</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">min</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> yScale<br>  output</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">y \
</span><span class="" style="color:rgb(102,102,0)">=</span><span class="" \
style="color:rgb(0,0,0)"> </span><span class="" \
style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">max \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> xScale<br> </span><span class="" \
style="color:rgb(102,0,102)">Else</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,0,102)">If</span><span class="" \
style="color:rgb(0,0,0)"> rotation </span><span class="" \
style="color:rgb(0,0,136)">is</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(0,102,102)">180</span><span class="" \
style="color:rgb(0,0,0)"> degrees</span><span class="" \
style="color:rgb(102,102,0)">:</span><span class="" style="color:rgb(0,0,0)"><br>  \
output</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x </span><span class="" \
style="color:rgb(102,102,0)">=</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">max \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> xScale<br>  output</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">y \
</span><span class="" style="color:rgb(102,102,0)">=</span><span class="" \
style="color:rgb(0,0,0)"> </span><span class="" \
style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">y</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">max \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">y</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> yScale<br> </span><span class="" \
style="color:rgb(102,0,102)">Else</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,0,102)">If</span><span class="" \
style="color:rgb(0,0,0)"> rotation </span><span class="" \
style="color:rgb(0,0,136)">is</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(0,102,102)">270</span><span class="" \
style="color:rgb(0,0,0)"> degrees</span><span class="" \
style="color:rgb(102,102,0)">:</span><span class="" style="color:rgb(0,0,0)"><br>  \
output</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x </span><span class="" \
style="color:rgb(102,102,0)">=</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">y</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">max \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">y</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> yScale<br>  output</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">y \
</span><span class="" style="color:rgb(102,102,0)">=</span><span class="" \
style="color:rgb(0,0,0)"> </span><span class="" \
style="color:rgb(102,102,0)">(</span><span class="" \
style="color:rgb(0,0,0)">raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">x \
</span><span class="" style="color:rgb(102,102,0)">-</span><span class="" \
style="color:rgb(0,0,0)"> raw</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">x</span><span class="" \
style="color:rgb(102,102,0)">.</span><span class="" \
style="color:rgb(0,0,0)">min</span><span class="" \
style="color:rgb(102,102,0)">)</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,102,0)">*</span><span class="" \
style="color:rgb(0,0,0)"> xScale<br> </span><span class="" \
style="color:rgb(102,0,102)">End</span><span class="" style="color:rgb(0,0,0)"> \
</span><span class="" style="color:rgb(102,0,102)">If</span></code></pre></div><div \
class="gmail_extra"><br>These are taken from this page: <a \
href="https://source.android.com/devices/tech/input/touch-devices.html">https://source.android.com/devices/tech/input/touch-devices.html</a></div>
 <div class="gmail_extra"><br></div><div class="gmail_extra">The problem might be \
that X is not calculating the correct cursor positions when the screen is rotated \
                using xrandr</div><div class="gmail_extra"><br></div><div \
                class="gmail_extra">
-Sandeep<br><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 2:59 PM, Sandeep \
<span dir="ltr">&lt;<a href="mailto:sandy.8925@gmail.com" \
target="_blank">sandy.8925@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
 <div dir="ltr">For input, I am using xf86-input-evdev . I am not using the \
proprietary eGalax driver. I might be wrong about the input rotating with the screen. \
<div><br></div><div>The problem is the mouse cursor/pointer location does not \
correspond to the touch input. The movement of the cursor does correspond to the \
touch input, but seems to be rotated the same way the screen has been rotated.</div>

<div><br></div><div>For example, assume a 11 inch display with a resolution of \
1280*800 . The default orientation is the upright landscape orientation. I use the \
KDE screen rotation utility (krandrtray) to rotate the screen left by 90 \
degrees(portrait). When I touch near the top left corner (in the upright landscape \
orientation), the mouse cursor jumps to a corresponding position near the top left \
corner in portrait mode.</div>

<div><br></div><div>So, there is a definite pattern connecting the touch input \
position and the mouse cursor position - it looks like the input position is rotated \
the same way display was rotated.</div><div><br></div><div>

If I use the coordinate transformation matrix in the script here: <a \
href="https://wiki.archlinux.org/index.php/Multitouch_Displays#Rotating_the_touch_screen" \
target="_blank">https://wiki.archlinux.org/index.php/Multitouch_Displays#Rotating_the_touch_screen</a> \
(see &quot;Rotating the touch screen&quot; section)</div>

<div><br></div><div>It works correctly - the mouse cursor follows the touch \
input.</div><div><br></div><div>Also, this problem is not specific to KDE, but also \
GNOME and even the Fluxbox window manager.</div><span class=""><font \
color="#888888"><div> <br></div>
<div>-Sandeep</div><div><br></div><div><br></div><div><br></div><div><br></div></font></span></div><div \
class=""><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On \
Mon, Oct 21, 2013 at 2:41 PM, Peter Hutterer <span dir="ltr">&lt;<a \
href="mailto:peter.hutterer@who-t.net" \
target="_blank">peter.hutterer@who-t.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>On \
Fri, Oct 04, 2013 at 05:36:00PM -0700, Sandeep wrote:<br>

&gt; Hi,<br>
&gt;<br>
&gt; I have an Acer Iconia Tab W500. It has an eGalax touchscreen. Single touch<br>
&gt; input  works.<br>
&gt;<br>
&gt; I mainly use KDE, and when I rotate the screen using the Krandrtray<br>
&gt; application, the mouse input works fine, but the touchscreen input does not<br>
&gt; work correctly.<br>
&gt;<br>
&gt; Here is a video showing the problem:<br>
&gt; <a href="http://www.youtube.com/watch?v=OviHJmjhoOI" \
target="_blank">http://www.youtube.com/watch?v=OviHJmjhoOI</a><br> &gt;<br>
&gt; It looks like the touch driver rotates the input in the same way that the<br>
&gt; screen is rotated, thus producing wrong/unexpected behaviour.<br>
&gt;<br>
&gt; I tried searching for existing bugs at <a href="http://bugs.freedesktop.org" \
target="_blank">bugs.freedesktop.org</a> and it doesn&#39;t<br> &gt; look like any of \
them cover this problem. Does anyone know what the problem<br> &gt; might be, and how \
I can figure out where the problem lies?<br> <br>
</div></div>what driver are you using? no X driver currently rotates with the \
screen,<br> it&#39;s something that needs to be triggered from the outside so chances \
are<br> that whatever triggers the rotation in KDE is triggering the wrong thing.<br>
<br>
Cheers,<br>
   Peter<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>



_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: freedesktop-xorg@progressive-comp.com

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

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