From owner-freebsd-current@freebsd.org Wed Feb 15 21:57:34 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 20A83CDF7EC for ; Wed, 15 Feb 2017 21:57:34 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0207A10C6; Wed, 15 Feb 2017 21:57:33 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from [127.0.0.1] (helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1ce7Zn-000EFL-FM; Wed, 15 Feb 2017 13:57:28 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id v1FLvQRU054766; Wed, 15 Feb 2017 13:57:26 -0800 (PST) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Wed, 15 Feb 2017 13:57:26 -0800 From: Oleksandr Tymoshenko To: Andriy Gapon Cc: wulf@cicgroup.ru, FreeBSD Current Subject: Re: basic evdev setup Message-ID: <20170215215725.GA53525@bluezbox.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD/11.0-RELEASE-p2 (amd64) User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: 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? [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 21:57:34 -0000 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 -- gonzo