All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Gerd Hoffmann <kraxel@suse.de>,
	Xen devel list <xen-devel@lists.xensource.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: Re: [patch] pvfb: Split mouse and keyboard into separate devices.
Date: Sat, 3 Feb 2007 03:51:03 +0000	[thread overview]
Message-ID: <20070203035103.GA15384@redhat.com> (raw)
In-Reply-To: <20070203002825.GH18218@redhat.com>

On Sat, Feb 03, 2007 at 12:28:25AM +0000, Daniel P. Berrange wrote:
> On Fri, Feb 02, 2007 at 06:11:54PM +0000, Keir Fraser wrote:
> > On 2/2/07 16:29, "Gerd Hoffmann" <kraxel@suse.de> wrote:
> > 
> > >> I guess I'll wait for this before applying the patch then.
> > > 
> > > With Xorg 7.2, this patch, and the device id patch on top you can add
> > > this ...
> > > 
> > > Section "InputDevice"
> > >   Driver        "evdev"
> > >   Identifier    "xenptr"
> > >   Option        "SendCoreEvents" "true"
> > >   Option        "vendor"        "0x5853"
> > >   Option        "product"       "0x0003"
> > > EndSection
> > > 
> > > ... as additional (to the default /dev/input/mice) input device.  The
> > > new input device must also be added to the serverlayout section.
> > > WorksForMe[tm].
> > 
> > The complaint is that it doesn't work out of the box with current Xorg. If
> > that is a showstopper (it certainly is at the very least very undesirable!)
> > then it doesn't matter how simple the required config change is -- if any
> > change is required at all then the patch is untenable.
> > 
> > How hard would it be to contineu to provide the combined device as well as
> > the new split-out pointer device?
> 
> I've just hacked up such a version and it appears to work fine - although
> you need a slightly more complicated Xorg config to get the absolute
> pointer working.
> 
> So what the patch does is this:
> 
>   - One input device supplies both mouse & keyboard events - this is 
>     basically same as current PVFB setup (appears /dev/input/event0)
>   - A second device supplies only mouse events (/dev/input/event1)
> 
> So with a default Xorg config, X works just as before - the server sees
> the relative co-ords via its default 'mouse' driver.

Well, this all really got me wondering why are we trying to jump through
all these hoops to let have keyboard events routed differently from
mouse events. Since a single /dev/input/eventX device can provide both
keyboard and mouse events, and the evdev driver is perfectly capable of 
processing both keyboard and mouse events, why can't a single InputDevice
config do the whole job.

So I tried out:

  Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "Screen0" 0 0
        InputDevice    "XenInput0" "CoreKeyboard"
        InputDevice    "XenInput0" "CorePointer"
  EndSection

  Section "InputDevice"
        Identifier  "XenInput0"
        Driver      "evdev"
        Option      "Device" "/dev/input/event0"
  EndSection

This made X rather unhappy - it fails to start, segv'ing badly. So, I put 
back in the generic keyboard device and set is as the CoreKeyboard:

  Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
  EndSection

X now starts, but the Keyboard0 driver never sees any key events. Then it
occurred to me that perhaps if I set 'SendCoreEvents' in the XenInput0
device, the keyboard events would get merged into the feed from Keyboard0.
Which they did.  So unless I'm missing something, it would seem that all
the patches in this thread are unneccessary. We can simply have a single
input device, and have the flexibility of being able to let X autoconfigure
itself in relative mouse mode, or explicitly add the config to switch it
in absolute mouse mode. 

For the record, my complete config file which makes absolute mouse events
work is:

  Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "XenInput0" "CorePointer"
  EndSection

  Section "ServerFlags"
        Option      "AllowMouseOpenFail" "yes"
  EndSection

  Section "InputDevice"
        Identifier  "XenInput0"
        Driver      "evdev"
        Option      "CorePointer"
        Option      "SendCoreEvents"
        Option      "Device" "/dev/input/event0"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
  EndSection

  Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
  EndSection

  Section "Device"
        Identifier  "Videocard0"
        Driver      "fbdev"
  EndSection

  Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
  EndSection

NB, the Fedora Core 6  evdev has a bug in it causing slightly jittery
mouse even in absolute mode, but there's trivial fix for it, and I think
the upstream version is already fixed.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

  reply	other threads:[~2007-02-03  3:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-01 10:59 [patch] pvfb: Split mouse and keyboard into separate devices Gerd Hoffmann
2007-02-01 13:15 ` Markus Armbruster
2007-02-01 13:47   ` Gerd Hoffmann
2007-02-01 17:37 ` Markus Armbruster
2007-02-01 18:05   ` Daniel P. Berrange
2007-02-02  8:39     ` Gerd Hoffmann
2007-02-02 15:25       ` Keir Fraser
2007-02-02 16:29         ` Gerd Hoffmann
2007-02-02 18:11           ` Keir Fraser
2007-02-03  0:28             ` Daniel P. Berrange
2007-02-03  3:51               ` Daniel P. Berrange [this message]
2007-02-05  9:20                 ` Gerd Hoffmann
2007-02-05 14:19                 ` Gerd Hoffmann
2007-02-05  9:10               ` Gerd Hoffmann
2007-02-05 20:55                 ` Daniel P. Berrange
2007-02-06  8:48                   ` Gerd Hoffmann
2007-02-06 13:45                     ` Daniel P. Berrange
2007-02-06 15:05                       ` Gerd Hoffmann
2007-02-06 18:40                     ` Markus Armbruster
2007-02-07  9:35                       ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070203035103.GA15384@redhat.com \
    --to=berrange@redhat.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=armbru@redhat.com \
    --cc=kraxel@suse.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.