mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-24 17:44:05 +00:00
Compare commits
12 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e26fc3c66c | ||
|
|
a759610292 | ||
|
|
21ff2ca7d1 | ||
|
|
c67f191d5b | ||
|
|
1978a2555b | ||
|
|
0909a1a765 | ||
|
|
20bb8d6b9f | ||
|
|
1e88664d95 | ||
|
|
d84e0035d1 | ||
|
|
6c75acfcdf | ||
|
|
eaf847be16 | ||
|
|
d319092d55 |
19
configure.ac
19
configure.ac
@@ -23,7 +23,7 @@
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-input-libinput],
|
||||
[0.27.1],
|
||||
[0.28.1],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
[xf86-input-libinput])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
@@ -47,6 +47,23 @@ XORG_DEFAULT_OPTIONS
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto [inputproto >= 2.2])
|
||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.4.901])
|
||||
|
||||
OLD_LIBS=$LIBS
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
LIBS="$LIBS $LIBINPUT_LIBS"
|
||||
CFLAGS="$CFLAGS $LIBINPUT_CFLAGS"
|
||||
AC_MSG_CHECKING([if libinput_device_touch_get_touch_count is available])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||
[[libinput_device_touch_get_touch_count(NULL)]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_LIBINPUT_TOUCH_COUNT, [1],
|
||||
[libinput_device_touch_get_touch_count() is available])
|
||||
[libinput_have_touch_count=yes]],
|
||||
[AC_MSG_RESULT([no])
|
||||
[libinput_have_touch_count=no]])
|
||||
LIBS=$OLD_LIBS
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
|
||||
# Define a configure option for an alternate input module directory
|
||||
AC_ARG_WITH(xorg-module-dir,
|
||||
AC_HELP_STRING([--with-xorg-module-dir=DIR],
|
||||
|
||||
@@ -15,11 +15,11 @@ libinput \- libinput-based X.Org input driver
|
||||
|
||||
.SH NOTE
|
||||
This is the man page for the X input driver. If you are looking for the
|
||||
library documentation, go to
|
||||
library documentation, go to
|
||||
.BI http://wayland.freedesktop.org/libinput/doc/
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B libinput
|
||||
.B libinput
|
||||
is an __xservername__ input driver based on libinput. It
|
||||
therefore supports all input devices that libinput can handle, including
|
||||
most mice, keyboards, tablets and touchscreens.
|
||||
@@ -37,7 +37,7 @@ Please refer to __xconfigfile__(__filemansuffix__) for general configuration
|
||||
details and for options that can be used with all input drivers. This
|
||||
section only covers configuration details specific to this driver.
|
||||
.PP
|
||||
The following driver
|
||||
The following driver
|
||||
.B Options
|
||||
are supported:
|
||||
.TP 7
|
||||
@@ -277,7 +277,7 @@ enabled on this device.
|
||||
.BI "libinput Tablet Tool Pressurecurve"
|
||||
4 32-bit float values [0.0 to 1.0]. See section
|
||||
.B TABLET TOOL PRESSURE CURVE
|
||||
.TP7
|
||||
.TP 7
|
||||
.BI "libinput Tablet Tool Area Ratio"
|
||||
2 32-bit values, corresponding to width and height. Special value 0, 0
|
||||
resets to the default ratio. See section
|
||||
|
||||
@@ -116,7 +116,7 @@ draglock_get_meta(const struct draglock *dl)
|
||||
}
|
||||
|
||||
size_t
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t sz)
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t nelem)
|
||||
{
|
||||
unsigned int i;
|
||||
size_t last = 0;
|
||||
@@ -131,8 +131,8 @@ draglock_get_pairs(const struct draglock *dl, int *array, size_t sz)
|
||||
}
|
||||
|
||||
/* size N array with a[0] == 0, the rest ordered by button number */
|
||||
memset(array, 0, sz * sizeof(array[0]));
|
||||
for (i = 0; i < sz && i < ARRAY_SIZE(dl->lock_pair); i++) {
|
||||
memset(array, 0, nelem * sizeof(array[0]));
|
||||
for (i = 0; i < nelem && i < ARRAY_SIZE(dl->lock_pair); i++) {
|
||||
array[i] = dl->lock_pair[i];
|
||||
if (array[i] != 0 && i > last)
|
||||
last = i;
|
||||
@@ -153,20 +153,20 @@ draglock_set_meta(struct draglock *dl, int meta_button)
|
||||
}
|
||||
|
||||
int
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t sz)
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t nelem)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (sz == 0 || array[0] != 0)
|
||||
if (nelem == 0 || array[0] != 0)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < sz; i++) {
|
||||
for (i = 0; i < nelem; i++) {
|
||||
if (array[i] < 0 || array[i] >= DRAGLOCK_MAX_BUTTONS)
|
||||
return 1;
|
||||
}
|
||||
|
||||
dl->mode = DRAGLOCK_DISABLED;
|
||||
for (i = 0; i < sz; i++) {
|
||||
for (i = 0; i < nelem; i++) {
|
||||
dl->lock_pair[i] = array[i];
|
||||
if (dl->lock_pair[i])
|
||||
dl->mode = DRAGLOCK_PAIRS;
|
||||
|
||||
@@ -107,13 +107,13 @@ draglock_get_meta(const struct draglock *dl);
|
||||
* @note Button numbers start at 1, array[0] is always 0.
|
||||
*
|
||||
* @param[in|out] array Caller-allocated array to hold the button mappings.
|
||||
* @param[in] sz Maximum number of elements in array
|
||||
* @param[in] nelem Maximum number of elements in array
|
||||
*
|
||||
* @return The number of valid elements in array or 0 if the current mode is
|
||||
* not DRAGLOCK_PAIRS
|
||||
*/
|
||||
size_t
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t sz);
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t nelem);
|
||||
|
||||
/**
|
||||
* Set the drag lock config to the DRAGLOCK_META mode, with the given
|
||||
@@ -140,7 +140,7 @@ draglock_set_meta(struct draglock *dl, int meta_button);
|
||||
* @return 0 on successor nonzero otherwise
|
||||
*/
|
||||
int
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t sz);
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t nelem);
|
||||
|
||||
/**
|
||||
* Process the given button event through the drag lock state machine.
|
||||
|
||||
@@ -1058,11 +1058,13 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
||||
{
|
||||
DeviceIntPtr dev = pInfo->dev;
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
struct libinput_device *device = driver_data->shared_device->device;
|
||||
int min, max, res;
|
||||
unsigned char btnmap[MAX_BUTTONS + 1];
|
||||
Atom btnlabels[MAX_BUTTONS];
|
||||
Atom axislabels[TOUCHPAD_NUM_AXES];
|
||||
int nbuttons = 7;
|
||||
int ntouches = TOUCH_MAX_SLOTS;
|
||||
|
||||
init_button_map(btnmap, ARRAY_SIZE(btnmap));
|
||||
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
|
||||
@@ -1086,7 +1088,13 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
||||
xf86InitValuatorAxisStruct(dev, 1,
|
||||
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y),
|
||||
min, max, res * 1000, 0, res * 1000, Absolute);
|
||||
InitTouchClassDeviceStruct(dev, TOUCH_MAX_SLOTS, XIDirectTouch, 2);
|
||||
|
||||
#if HAVE_LIBINPUT_TOUCH_COUNT
|
||||
ntouches = libinput_device_touch_get_touch_count(device);
|
||||
if (ntouches == 0) /* unknown - mtdev */
|
||||
ntouches = TOUCH_MAX_SLOTS;
|
||||
#endif
|
||||
InitTouchClassDeviceStruct(dev, ntouches, XIDirectTouch, 2);
|
||||
|
||||
}
|
||||
|
||||
@@ -1697,7 +1705,7 @@ xf86libinput_handle_touch(InputInfoPtr pInfo,
|
||||
if ((driver_data->capabilities & CAP_TOUCH) == 0)
|
||||
return;
|
||||
|
||||
slot = libinput_event_touch_get_slot(event);
|
||||
slot = libinput_event_touch_get_seat_slot(event);
|
||||
|
||||
switch (event_type) {
|
||||
case LIBINPUT_EVENT_TOUCH_DOWN:
|
||||
@@ -2084,7 +2092,7 @@ static inline DeviceIntPtr
|
||||
xf86libinput_find_device_for_tool(InputInfoPtr pInfo,
|
||||
struct libinput_tablet_tool *tool)
|
||||
{
|
||||
struct xf86libinput *dev = pInfo->private;
|
||||
struct xf86libinput *dev;
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
struct xf86libinput_device *shared_device = driver_data->shared_device;
|
||||
uint64_t serial = libinput_tablet_tool_get_serial(tool);
|
||||
@@ -2684,9 +2692,9 @@ xf86libinput_parse_calibration_option(InputInfoPtr pInfo,
|
||||
libinput_device_config_calibration_get_matrix(device, matrix);
|
||||
memcpy(matrix_out, matrix, sizeof(matrix));
|
||||
|
||||
str = xf86CheckStrOption(pInfo->options,
|
||||
"CalibrationMatrix",
|
||||
NULL);
|
||||
str = xf86SetStrOption(pInfo->options,
|
||||
"CalibrationMatrix",
|
||||
NULL);
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
@@ -2914,7 +2922,7 @@ xf86libinput_parse_draglock_option(InputInfoPtr pInfo,
|
||||
{
|
||||
char *str;
|
||||
|
||||
str = xf86CheckStrOption(pInfo->options, "DragLockButtons",NULL);
|
||||
str = xf86SetStrOption(pInfo->options, "DragLockButtons", NULL);
|
||||
if (draglock_init_from_string(&driver_data->draglock, str) != 0)
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Invalid DragLockButtons option: \"%s\"\n",
|
||||
@@ -5318,7 +5326,7 @@ LibinputInitDragLockProperty(DeviceIntPtr dev,
|
||||
break;
|
||||
case DRAGLOCK_PAIRS:
|
||||
sz = draglock_get_pairs(&driver_data->draglock,
|
||||
dl_values, sizeof(dl_values));
|
||||
dl_values, ARRAY_SIZE(dl_values));
|
||||
break;
|
||||
default:
|
||||
xf86IDrvMsg(dev->public.devicePrivate,
|
||||
|
||||
Reference in New Issue
Block a user