From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: Re: [patch] pvfb: Split mouse and keyboard into separate devices. Date: Sat, 3 Feb 2007 03:51:03 +0000 Message-ID: <20070203035103.GA15384@redhat.com> References: <45C36705.5080600@suse.de> <20070203002825.GH18218@redhat.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20070203002825.GH18218@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Gerd Hoffmann , Xen devel list , Markus Armbruster List-Id: xen-devel@lists.xenproject.org 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" 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 -=|