Add Rotate support to a driver

Peter Hutterer peter.hutterer at who-t.net
Thu May 13 16:16:10 PDT 2010


On Thu, May 13, 2010 at 10:30:17PM +0300, yoni dana wrote:
> Thanks for the reply. I am writing an x11 input driver. I have a
> looked at some x11 input driver
> and didn't see the XRRScreenChangeNotify  function, is there another way
> i can detect screen rotation so i can swap between X and Y coordinate
> thank you

you need to write an X client (== application) to handle this situation.
input drivers don't have access to these events directly, so you won't find
any code in evdev/synaptics/... do handle this.

the order of events is
user triggers rotation 
   X server rotates 
   X server sends RRNotify events
        your client receives event
        your client triggers input rotation
            input driver rotates.

one question I have to ask you though - why are you writing an input driver?
there's a good chance that the device may be supported by evdev (of if not,
should be supported in the kernel instead). That's if you're on linux
anyway.

Cheers,
  Peter

> i have look at the synaptic and evdev driver and didn't see
> XRRScreenChangeNotify
> function, is there another wahy
> On Wed, May 12, 2010 at 12:52 PM, Éric Piel <E.A.B.Piel at tudelft.nl> wrote:
> > Op 12-05-10 07:39, yoni dana schreef:
> >> Hi
> >> i have implemented and X11 input driver,
> >> i need to add support to screen rotation,
> >> My questions is
> >> How can i detect screen rotation occurred
> >> (For Example i use xrandr -o left )
> > I think you can do this in a X client which listens to the
> > XRRScreenChangeNotify event on the root window. See the Xrandr(3) man
> > page for more info. Then, your client can request a change of
> > orientation to the input via an input property.
> >
> > Eric
> >



More information about the xorg mailing list