Is it possible to pan around a virtual screen using a smaller touchscreen display

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 21 14:38:54 PDT 2015


On Tue, Apr 21, 2015 at 02:50:47PM +0100, Daniel Harris wrote:
> Hello Peter
> 
> I appreciate your reply.  I am not sure we are talking about the same thing
> so I have uploaded a video to youtube showing the problem i am experiencing
> 
> If anyone is interested you can find it here http://youtu.be/n8N0NnB9u7g

yeah, definitely the same thing. look at the distances of the pointer and
the stylus relative to their origins - when the stylus is half-way down the
device, the pointer is half-way down the whole screen. That's the basic
problem - an absolute device is always mapped to the whole screen/desktop
area.

> are you saying the pointer position can be corrected with a client app or
> can it only be fixed in X.

yes, google for xinput coordinate transformation matrix and you'll find a
few tutorials, hints on how to do it. xinput map-to-output does the same,
though in your case it's a bit trickier because you need to get the 
viewport and calculate the respective matrix. Still just moving numbers
around, not technically hard.

the difficult bit is getting the current viewport, where the xf86VidMode
extension looks like the most likely candidate. possibly RandR, but I don't
know the details on how to do it on either, sorry.

Cheers,
   Peter


> On Tue, Apr 21, 2015 at 2:41 AM, Peter Hutterer <peter.hutterer at who-t.net>
> wrote:
> 
> > On Mon, Apr 20, 2015 at 05:21:44PM +0100, Daniel Harris wrote:
> > > I am assuming that it is a limitation that a stylus cannot map it
> > position
> > > to a physical screen and a larger virtual screen at the same time.  I
> > > currently have panning in the virtual screen but calibration is way off
> > on
> > > the physical screen.  I am assuming no mathematical wizardry with the
> > > current setting can rectify this.
> >
> > should be able to, it just requires more effort once you start panning
> > around. the mapping of the stylus to screen is done by a matrix that takes
> > the whole desktop size into account. outputs as such don't matter here,
> > e.g.
> > mapping to the right of two monitors is done by mapping to the 50% of the
> > width with a 50% offset.
> >
> > that means you can map to any part of the desktop, problem is it won't
> > follow you around as you pan. you'd need some client to track that and
> > update the coordinate transformation matrix as you go.
> >
> > Cheers,
> >    Peter
> >
> >
> > > On Sat, Apr 18, 2015 at 4:19 PM, Daniel Harris <
> > mail.dharris at googlemail.com>
> > > wrote:
> > >
> > > > Hello
> > > >
> > > > I have a surface pro 2 and would like to create a virtual screen of
> > > > 3840x2160 and pan around using the 1920x1080 stylus enabled
> > touchscreen on
> > > > the surface pro 2.  I have Ubuntu installed and the screen setup but I
> > > > cannot get the stylus to function correctly with that setup.  I have
> > tried
> > > > experimenting with the translation matrix but with no success.
> > > >
> > > > Is the above setup possible?
> > > >
> > > > I would welcome any advice as to how to achieve this setup
> > > >
> > > > Thanks in advance
> > > >
> > > > Dan
> > > >
> >
> > > _______________________________________________
> > > xorg at lists.x.org: X.Org support
> > > Archives: http://lists.freedesktop.org/archives/xorg
> > > Info: http://lists.x.org/mailman/listinfo/xorg
> > > Your subscription address: %(user_address)s
> >
> >


More information about the xorg mailing list