From owner-freebsd-current@freebsd.org Wed Feb 15 23:45:06 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3324CE0313; Wed, 15 Feb 2017 23:45:06 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 2691ACC1; Wed, 15 Feb 2017 23:45:04 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id 3AB2E1BF07; Thu, 16 Feb 2017 02:38:04 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id CTp2U1x4qAjJ; Thu, 16 Feb 2017 02:37:57 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id D2D4E1BF00; Thu, 16 Feb 2017 02:37:57 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id 11AB5574A30; Thu, 16 Feb 2017 02:37:53 +0300 (MSK) X-Virus-Scanned: amavisd-new at cicgroup.ru Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id vSPXe1YY3iHa; Thu, 16 Feb 2017 02:37:39 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTPA id 6706D573871; Thu, 16 Feb 2017 02:37:39 +0300 (MSK) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 16 Feb 2017 02:37:39 +0300 From: Vladimir Kondratyev To: Andriy Gapon Cc: FreeBSD Current , owner-freebsd-current@freebsd.org, Oleksandr Tymoshenko Subject: Re: basic evdev setup In-Reply-To: <20170215215725.GA53525@bluezbox.com> References: <20170215215725.GA53525@bluezbox.com> Message-ID: X-Sender: vladimir@kondratyev.su User-Agent: Roundcube Webmail/1.2.2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 23:45:06 -0000 Hi, Andriy I can add my 2 cents to Oleksander`s 1. If xf86-input-keyboard is not used as primary keyboard driver, patch [1] should be applied to xorg-server to prevent ttyv8<->xorg frame buffers interference 2. It`s also worth trying one of PR/196678 patches to xorg devd configuration backend [2] 3. To see events going through evdev interface, evemu-record utility from evemu package [3] can be used. [1] https://reviews.freebsd.org/differential/changeset/?ref=218662 [2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678 [3] https://www.freedesktop.org/software/evemu/ 1, 2 and 3 was collected together at https://reviews.freebsd.org/D7588 but this review is somewhat outdated now. On 2017-02-16 00:57, Oleksandr Tymoshenko wrote: > Andriy Gapon (avg@FreeBSD.org) wrote: >> >> Oleksandr, >> >> at the moment the documentation for evdev on FreeBSD is very scarce, >> even if we >> talk about wiki pages, informal howto-s or blog posts. >> So, I would like to ask your help for a very basic evdev test setup. >> >> All input devices I have are standard keyboard and a mouse with some >> extra keys. >> I would like to be able to use the keyboard and the mouse as usual >> when in the >> console. And I would like to be able to use the extra mouse keys in >> X. >> >> What steps should I take to achieve that? >> I already evdev + EVDEV_SUPPORT on the kernel side in addition to the >> regular >> keyboard and mouse drivers (atkbdc + ums). >> I have also installed xf86-input-evdev. >> >> Do I need any additional kernel evedev configuration via sysctl? >> What should I add to xorg configuration to enable evdev for X? > > * Adding Vladimir Kondratyev to Cc since he's contributed evdev patch > > Hi Andriy, > > evdev works in parallel with standard input system, so you don't > have to worry about console input support. > > Current evdev implementation uses following devices as a source > of input events: ukbd(4), ums(4), atkbd(4), kbdmux(4), sysmouse(4) > > As you see three of them are actual hardware and two of them are > virtual aggregating devices. You can enable/disable particular > sources using kern.evdev.rcpt_mask sysctl. There are four controlling > bits to enable/disable driver as a source of events: > bit 0: is set enables sysmouse > bit 1: is set enables kbdmux > bit 2: is set enables ums > bit 3: is set enables atkbd, ukbd > > By default sysmouse and kbdmux are enabled. Sysmouse requires > moused to work, so make sure that moused is running on your system. > > In your Xorg config you'll need something like this: > > Section "InputDevice" > Identifier "Mouse0" > Driver "evdev" > Option "Device" "/dev/input/event0" > EndSection > > Section "InputDevice" > Identifier "Keyboard0" > Driver "evdev" > Option "Device" "/dev/input/event1" > EndSection > > I didn't test Xorg thoroughly so there might be some undiscovered > bugs. My target use case was Qt in EGLFS mode. If you have any > questions or bugreports - I'll be glad to answer them