Commit Graph

15 Commits

Author SHA1 Message Date
Benjamin Tissoires d511a3016a Add missing labels for multitouch valuators
ABS_MT_DISTANCE exists since kernel v2.6.38,
ABS_MT_TOOL_X|Y appeared in v3.6.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-30 15:11:10 +10:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Daniel Stone 78d8d6dd7f Input: Add vertical and horizontal scroll axes
To be used for smooth scrolling with future driver APIs, replacing
Rel Vert Wheel and Rel Horiz Wheel axes, which have not been used in any
open driver to date.

Combined with double-granularity ValuatorMasks, these axes allow for
fine-grained scroll data to be sent to clients.  Future commits allow
drivers to post these scroll axes to
QueuePointerEvents/GetPointerEvents, which take care of emulating legacy
scroll button events.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:26:43 +10:00
Lennart Poettering 159b03e137 config: add udev/systemd multi-seat support
Add support for multi-seat-aware input device hotplugging. This
implements the multi-seat scheme explained here:

http://www.freedesktop.org/wiki/Software/systemd/multiseat

This introduces a new X server switch "-seat" which allows configuration
of the seat to enumerate hotplugging devices on. If specified the value
of this parameter will also be exported as root window property
Xorg_Seat.

To properly support input hotplugging devices need to be tagged in udev
according to the seat they are on. Untagged devices are assumed to be on
the default seat "seat0". If no "-seat" parameter is passed only devices
on "seat0" are used. This means that the new scheme is perfectly
compatible with existing setups which have no tagged input devices.

Note that the -seat switch takes a completely generic identifier, and
that it has no effect on non-Linux systems. In fact, on other OSes a
completely different identifier scheme for seats could be used but still
be exposed with the Xorg_Seat and -seat.

I tried to follow the coding style of the surrounding code blocks if
there was any one could follow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:49 +10:00
Peter Hutterer 4621bb270a Add a property for device/product ID.
In some cases, knowing about the device model number and the device's vendor
is important to activate product-specific settings. Since this is
nonetheless driver-specific, only provide the property but don't do anything
with it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-26 15:27:10 +10:00
Peter Hutterer f26a5b9a99 Xi: add device node property to known properties.
Since the server has little choice (or even knowledge) of the actual device
node used by the driver, this property is merely provided for
standardisation. It is up to the driver to set it to the appropriate value,
usually a device node in the form of /dev/input/event0 or similar.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
2011-05-26 15:27:10 +10:00
Peter Korsgaard 6cccf0131c dix: add 3x3 transformation matrix xinput property for multi-head handling
For absolute input devices (E.G. touchscreens) in multi-head setups,
we need a way to bind the device to an randr output. This adds the
infrastructure to the server to allow us to do so.

positionSprite() scales input coordinates to the dimensions of the shared
(total) screen frame buffer, so to restrict motion to an output we need to
scale/rotate/translate device coordinates to a subset of the frame buffer
before passing them on to positionSprite.

This is done here using a 3x3 transformation matrix, which is applied to
the device coordinates using homogeneous coordinates, E.G.:

[ c0 c1 c2 ]   [ x ]
[ c3 c4 c5 ] * [ y ]
[ c6 c7 c8 ]   [ 1 ]

Notice: As input devices have varying input ranges, the coordinates are
first scaled to the [0..1] range for generality, and afterwards scaled
back up.

E.G. for a dual head setup (using same resolution) next to each other, you
would want to scale the X coordinates of the touchscreen connected to the
both heads by 50%, and translate (offset) the coordinates of the rightmost
head by 50%, or in matrix form:

   left:            right:
[ 0.5 0 0 ]     [ 0.5 0 0.5 ]
[ 0   1 0 ]     [ 0   1 0   ]
[ 0   0 1 ]     [ 0   0 0   ]

Which can be done using xinput:

xinput set-prop <left> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0 0 1 0 0 0 1

xinput set-prop <right> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0.5 0 1 0 0 0 1

Likewise more complication setups involving more heads, rotation or
different resolution can be handled.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-28 16:49:30 +10:00
Benjamin Tissoires a34812b090 Add labels for multitouch valuators
Thoses definitions have been included in the kernel but the X server is not updated accordingly.
Without these definitions, the multitouch axes are not correctly labelled.

Signed-off-by: Benjamin Tissoires <tissoire@cena.fr>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-09 10:21:27 +10:00
Peter Hutterer 903c3db1d1 Xext: rename Xtst* to XTest*
This patch corrects a misnaming of XTest-related functions.

The extension itself announces itself as XTEST. Xtst is the library name
itself, but all library functions are prefixed by XTest. Same with the
naming in the server.

- Rename all *Xtst* functions to *XTest* for consistency with the library
  and in-server API.
- Rename the "Xtst device" property to "XTEST device" for consistency with
  the extension naming.
- Rename the device naming to "<master device name> XTEST device". The
  default xtest devices become "Virtual core XTEST pointer" and "Virtual
  core XTEST keyboard".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:51 +10:00
Peter Hutterer e13605ea40 dix: introduce "Xtst Device" label property.
Xtst devices get this property assigned automatically so they can be
detected easily by a client.
The property is read-only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-01 08:46:31 +10:00
Peter Hutterer a706dd8771 include: add a range of button labels.
Mostly the same buttons as defined by linux/input.h, with five exceptions:
"Button Unknown" for a button that cannot be labelled.
"Button Wheel Up", "Button Wheel Down" for buttons 4/5, traditionally the
wheel buttons.
"Button Horiz Wheel Up", "Button Horiz Wheel Down" for buttons 6/7,
traditionally the horiz. wheel buttons.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-03-03 07:07:30 +10:00
Peter Hutterer 01ffaf6834 Xi: define a range of axis labels.
This is copied from linux/input.h, presumably that's the ones at least the
Linux kernel can give us for any device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-23 08:09:29 +11:00
Simon Thum 19275ea8e9 dix: add property support for pointer acceleration.
Note: properties don't need to be cleaned up, the DIX does it for us anyway.
Data that is stored in properties is cleaned up by the property system.
Handlers, etc. don't need to be unregistered while cleaning up, as they get
deleted when the device is removed anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Simon Thum <simon.thum@gmx.de>
2009-01-15 09:28:55 +10:00
Peter Hutterer a48c81dcdf Xi: add XATOM_FLOAT to server-defined properties.
This property is used to denote type float for input properties. Such
properties can be accessed easily through the XIPropToFloat() function.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-01-12 12:55:27 +10:00
Peter Hutterer fbd09486c6 Push server-known properties into xserver-properties.h. 2008-09-26 13:32:11 +09:30