[PATCH v3 0/3] xfree86: Configure input devices by attributes

Dan Nicholson dbn.lists at gmail.com
Mon Dec 14 21:08:59 PST 2009


These patches add support in xorg.conf to apply input configuration to a
class of devices by attribute. The idea is to offer Xorg similar
property matching capabilities as the hal fdi system. Moving the
configuration back into the ddx means that some day we can stop doing it
from the config backend and asking users to adjust to it.

The mechanism used here is an InputClass section. Here is a contrived
example section showing all the current attribute matchers:

Section "InputClass"
	Identifier         "My Mice"

	MatchProduct       "Mouse"
	MatchVendor        "Mouse Company"
	MatchDevicePath    "/dev/input/event*"
	MatchIsPointer     "yes"
	MatchIsKeyboard    "no"
	MatchIsJoystick    "no"
	MatchIsTablet      "no"
	MatchIsTouchpad    "no"
	MatchIsTouchscreen "no"

	Driver             "evdev"
	Option             "InvertX" "on"
EndSection

Changes since v2:
* Changed xf86Bool to xf86TriState per Simon's suggestion. This more
  accurately describes the type, but I have no attachment to it.
* Added more matching types: vendor name, joystick, tablet, touchpad,
  and touchscreen. Also changed MatchName to MatchProduct to clearly
  identify what is being matched.
* Did not follow Daniel's suggestion of reusing the values from
  InputOptions. Since adding more matchers, it didn't make sense to
  grab two of them from a different spot. Also, since the callee might
  free some of the InputOptions, it was easier to treat InputAttributes
  as something that would not be changed.

Dan Nicholson (3):
  xfree86: Support non-Option boolean entries in configuration
  config: Introduce InputAttributes in NewInputDeviceRequest
  xfree86: Introduce InputClass configuration

 Xi/stubs.c                           |    3 +-
 config/dbus.c                        |    2 +-
 config/hal.c                         |   28 ++++-
 configure.ac                         |    2 +-
 hw/dmx/dmxinput.c                    |    3 +-
 hw/kdrive/src/kinput.c               |    3 +-
 hw/xfree86/common/xf86Option.c       |   25 +----
 hw/xfree86/common/xf86Xinput.c       |   96 ++++++++++++++-
 hw/xfree86/doc/man/xorg.conf.man.pre |   96 ++++++++++++++
 hw/xfree86/parser/Configint.h        |    4 +
 hw/xfree86/parser/InputClass.c       |  232 ++++++++++++++++++++++++++++++++++
 hw/xfree86/parser/Makefile.am        |    1 +
 hw/xfree86/parser/configProcs.h      |    4 +
 hw/xfree86/parser/read.c             |    8 ++
 hw/xfree86/parser/scan.c             |   30 +++++
 hw/xfree86/parser/write.c            |    2 +
 hw/xfree86/parser/xf86Parser.h       |   29 +++++
 hw/xfree86/parser/xf86tokens.h       |   13 ++-
 hw/xquartz/darwinXinput.c            |    3 +-
 include/dix-config.h.in              |    3 +
 include/input.h                      |   15 +++
 21 files changed, 570 insertions(+), 32 deletions(-)
 create mode 100644 hw/xfree86/parser/InputClass.c


More information about the xorg-devel mailing list