eGalax touchscreen and RandR rotation
sandy.8925 at gmail.com
Tue Oct 22 10:30:16 PDT 2013
Here's touch calculations taken from Android documentation on Linux touch
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
These are taken from this page:
The problem might be that X is not calculating the correct cursor positions
when the screen is rotated using xrandr
On Mon, Oct 21, 2013 at 2:59 PM, Sandeep <sandy.8925 at 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:
> (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.
> On Mon, Oct 21, 2013 at 2:41 PM, Peter Hutterer <peter.hutterer at 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
>> > 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
>> > 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
>> > screen is rotated, thus producing wrong/unexpected behaviour.
>> > I tried searching for existing bugs at bugs.freedesktop.org and it
>> > look like any of them cover this problem. Does anyone know what the
>> > 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the xorg