mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
3 Commits
master
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24368d8379 | ||
|
|
4996694cc9 | ||
|
|
05f7057ad5 |
65
.github/ISSUE_TEMPLATE/01-bug-report.yml
vendored
65
.github/ISSUE_TEMPLATE/01-bug-report.yml
vendored
@@ -1,65 +0,0 @@
|
|||||||
name: 🐞 Bug report
|
|
||||||
description: Create a report to help us improve
|
|
||||||
|
|
||||||
labels: [bug, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to help everyone identify and fix the bug. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: dropdown
|
|
||||||
id: affected-version
|
|
||||||
attributes:
|
|
||||||
label: Select the version
|
|
||||||
options:
|
|
||||||
- 2.11.0.1
|
|
||||||
- Git master branch
|
|
||||||
- other or don't know
|
|
||||||
default: 1
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Describe your issue
|
|
||||||
placeholder: When I did X then Y happened.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: steps
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce
|
|
||||||
placeholder: |
|
|
||||||
1. Start ...
|
|
||||||
2. Do this
|
|
||||||
3. Do that
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: expected
|
|
||||||
attributes:
|
|
||||||
label: What did you expect?
|
|
||||||
placeholder: I expected this to happen.
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
description: |
|
|
||||||
Additional information you want to provide such as logs, system info, environment, screenshots, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the bug here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-evdev/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for reporting this issue! We will get back to you as soon as possible.
|
|
||||||
49
.github/ISSUE_TEMPLATE/02-feature-request.yml
vendored
49
.github/ISSUE_TEMPLATE/02-feature-request.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: ✨ Feature request
|
|
||||||
description: Suggest a feature for this software
|
|
||||||
labels: [enhancement, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to properly describe the new software feature you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: "Describe the feature"
|
|
||||||
placeholder: A thing in X that allows to do Y.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: rationale
|
|
||||||
attributes:
|
|
||||||
label: "It should be done because"
|
|
||||||
placeholder: Doing Y is needed for Z.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: alternative
|
|
||||||
attributes:
|
|
||||||
label: "What are the alternatives?"
|
|
||||||
placeholder: We could do A or B instead.
|
|
||||||
- type: textarea
|
|
||||||
id: context
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: Additional information you want to provide such as references to related issues or protocols, the implications on existing use cases, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the feature request here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-evdev/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for your suggestion! Let's see together if it can be done.
|
|
||||||
49
.github/ISSUE_TEMPLATE/03-code-cleanup.yml
vendored
49
.github/ISSUE_TEMPLATE/03-code-cleanup.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: 🔧 Code cleanup
|
|
||||||
description: Level up the source code
|
|
||||||
labels: [code-cleanup, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to properly describe the code cleanup you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: "Describe the cleanup"
|
|
||||||
placeholder: C in X needs to be changed into D.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: rationale
|
|
||||||
attributes:
|
|
||||||
label: "It should be done because"
|
|
||||||
placeholder: Having D is needed for E.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: alternative
|
|
||||||
attributes:
|
|
||||||
label: "What are the alternatives?"
|
|
||||||
placeholder: We could do A or B instead.
|
|
||||||
- type: textarea
|
|
||||||
id: context
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: Additional information you want to provide such as implications on existing code, how to ensure API/ABI stability, which tests are needed or to be run, related issues, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the cleanup here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-evdev/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for looking at the source code! Let's see together how it can be improved.
|
|
||||||
38
.github/ISSUE_TEMPLATE/04-doc-update.yml
vendored
38
.github/ISSUE_TEMPLATE/04-doc-update.yml
vendored
@@ -1,38 +0,0 @@
|
|||||||
name: 🔖 Documentation update
|
|
||||||
description: Make your mark for better documentation
|
|
||||||
|
|
||||||
labels: [documentation, needs-triage]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to help others understand our software. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Describe the update
|
|
||||||
placeholder: These things need to be better documented.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
description: Additional information you want to provide such as tickets related to changes in the software, affected files, screenshots, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the update here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-evdev/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for requesting this update! We will get back to you as soon as possible.
|
|
||||||
43
.github/ISSUE_TEMPLATE/05-org-task.yml
vendored
43
.github/ISSUE_TEMPLATE/05-org-task.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
name: ✅ Organizational task
|
|
||||||
description: Create a task for project organization
|
|
||||||
|
|
||||||
labels: [needs-triage, organization]
|
|
||||||
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please fill out the sections below to get organizational things done. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Describe the task
|
|
||||||
placeholder: These things need to be done.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: rationale
|
|
||||||
attributes:
|
|
||||||
label: "It should be done because"
|
|
||||||
placeholder: Doing Y is needed for Z.
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
description: Additional information you want to provide such as the context for bigger tasks, the implicatons on existing workflows, related issues, etc.
|
|
||||||
placeholder: |
|
|
||||||
Add any other context about the task here.
|
|
||||||
- type: checkboxes
|
|
||||||
id: checks
|
|
||||||
attributes:
|
|
||||||
label: Extra fields
|
|
||||||
options:
|
|
||||||
- label: I have checked the existing [issues](https://github.com/X11Libre/xf86-input-evdev/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
|
|
||||||
required: true
|
|
||||||
- label: I'd like to work on this issue
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for adding this task! We will get back to you as soon as possible.
|
|
||||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: XLibre Community Support
|
|
||||||
url: https://github.com/orgs/X11Libre/discussions
|
|
||||||
about: Please ask and answer questions here.
|
|
||||||
- name: Mailing List
|
|
||||||
url: https://www.freelists.org/list/xlibre
|
|
||||||
about: You can join the discussions on our mailing list.
|
|
||||||
50
.github/workflows/build.yml
vendored
50
.github/workflows/build.yml
vendored
@@ -1,50 +0,0 @@
|
|||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ubuntu:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/target/ubuntu@v0.3.7
|
|
||||||
with:
|
|
||||||
xserver-version: ${{ matrix.xserver-version }}
|
|
||||||
|
|
||||||
freebsd:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/target/freebsd@v0.3.7
|
|
||||||
with:
|
|
||||||
xserver-version: ${{ matrix.xserver-version }}
|
|
||||||
|
|
||||||
dragonfly:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
# xlibre-xserver-25.0.x not compiling on dragonfly yet
|
|
||||||
xserver-version: [ master, xlibre-xserver-25.1.0 ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/target/dragonfly@v0.3.7
|
|
||||||
with:
|
|
||||||
xserver-version: ${{ matrix.xserver-version }}
|
|
||||||
|
|
||||||
# Not supported on NetBSD
|
|
||||||
|
|
||||||
release-notes:
|
|
||||||
name: Release pushed tag
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/xlibre-') }}
|
|
||||||
needs: [ ubuntu, freebsd, dragonfly ]
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: X11Libre/action-build-driver/release@v0.3.7
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -76,5 +76,3 @@ core
|
|||||||
# Edit the following section as needed
|
# Edit the following section as needed
|
||||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||||
#
|
#
|
||||||
man/evdev.4
|
|
||||||
man/evdev.man
|
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
#
|
|
||||||
# Catch-all evdev loader for udev-based systems
|
|
||||||
# We don't simply match on any device since that also adds accelerometers
|
|
||||||
# and other devices that we don't really want to use. The list below
|
|
||||||
# matches everything but joysticks.
|
|
||||||
|
|
||||||
Section "InputClass"
|
|
||||||
Identifier "evdev pointer catchall"
|
|
||||||
MatchIsPointer "on"
|
|
||||||
MatchDevicePath "/dev/input/event*"
|
|
||||||
Driver "evdev"
|
|
||||||
EndSection
|
|
||||||
|
|
||||||
Section "InputClass"
|
|
||||||
Identifier "evdev keyboard catchall"
|
|
||||||
MatchIsKeyboard "on"
|
|
||||||
MatchDevicePath "/dev/input/event*"
|
|
||||||
Driver "evdev"
|
|
||||||
EndSection
|
|
||||||
|
|
||||||
Section "InputClass"
|
|
||||||
Identifier "evdev touchpad catchall"
|
|
||||||
MatchIsTouchpad "on"
|
|
||||||
MatchDevicePath "/dev/input/event*"
|
|
||||||
Driver "evdev"
|
|
||||||
EndSection
|
|
||||||
|
|
||||||
Section "InputClass"
|
|
||||||
Identifier "evdev tablet catchall"
|
|
||||||
MatchIsTablet "on"
|
|
||||||
MatchDevicePath "/dev/input/event*"
|
|
||||||
Driver "evdev"
|
|
||||||
EndSection
|
|
||||||
|
|
||||||
Section "InputClass"
|
|
||||||
Identifier "evdev touchscreen catchall"
|
|
||||||
MatchIsTouchscreen "on"
|
|
||||||
MatchDevicePath "/dev/input/event*"
|
|
||||||
Driver "evdev"
|
|
||||||
EndSection
|
|
||||||
13
Makefile.am
13
Makefile.am
@@ -19,14 +19,15 @@
|
|||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# During distcheck, system locations (as provided by pkg-config) may
|
# Provide an sdk location that is writable by the evdev module
|
||||||
# not be writable; provide instead relative locations.
|
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --with-xorg-module-dir='$${libdir}/xorg/modules'
|
|
||||||
|
|
||||||
SUBDIRS = src man
|
SUBDIRS = src man include
|
||||||
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
||||||
|
|
||||||
dist_xorgconf_DATA = 10-evdev.conf
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = xorg-evdev.pc
|
||||||
|
|
||||||
|
|
||||||
.PHONY: ChangeLog INSTALL
|
.PHONY: ChangeLog INSTALL
|
||||||
|
|
||||||
@@ -37,5 +38,3 @@ ChangeLog:
|
|||||||
$(CHANGELOG_CMD)
|
$(CHANGELOG_CMD)
|
||||||
|
|
||||||
dist-hook: ChangeLog INSTALL
|
dist-hook: ChangeLog INSTALL
|
||||||
|
|
||||||
EXTRA_DIST = README.md
|
|
||||||
|
|||||||
20
README
Normal file
20
README
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
xf86-input-evdev - Generic Linux input driver for the Xorg X server
|
||||||
|
|
||||||
|
Please submit bugs & patches to the Xorg bugzilla:
|
||||||
|
|
||||||
|
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||||
|
|
||||||
|
All questions regarding this software should be directed at the
|
||||||
|
Xorg mailing list:
|
||||||
|
|
||||||
|
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||||
|
|
||||||
|
The master development code repository can be found at:
|
||||||
|
|
||||||
|
git://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdev
|
||||||
|
|
||||||
|
http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev
|
||||||
|
|
||||||
|
For more information on the git code manager, see:
|
||||||
|
|
||||||
|
http://wiki.x.org/wiki/GitPage
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
xf86-input-evdev - Generic Linux input driver for the XLibre X server
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
The primary development code repository can be found at:
|
|
||||||
|
|
||||||
https://github.com/X11Libre/xf86-input-evdev
|
|
||||||
|
|
||||||
Please submit bug reports and requests to merge patches there.
|
|
||||||
11
autogen.sh
11
autogen.sh
@@ -1,17 +1,14 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
srcdir=`dirname "$0"`
|
srcdir=`dirname $0`
|
||||||
test -z "$srcdir" && srcdir=.
|
test -z "$srcdir" && srcdir=.
|
||||||
|
|
||||||
ORIGDIR=`pwd`
|
ORIGDIR=`pwd`
|
||||||
cd "$srcdir"
|
cd $srcdir
|
||||||
|
|
||||||
autoreconf -v --install || exit 1
|
autoreconf -v --install || exit 1
|
||||||
cd "$ORIGDIR" || exit $?
|
cd $ORIGDIR || exit $?
|
||||||
|
|
||||||
git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
|
|
||||||
git config --local format.subjectPrefix "PATCH xf86-input-evdev"
|
|
||||||
|
|
||||||
if test -z "$NOCONFIGURE"; then
|
if test -z "$NOCONFIGURE"; then
|
||||||
exec "$srcdir"/configure "$@"
|
$srcdir/configure "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
56
configure.ac
56
configure.ac
@@ -22,16 +22,16 @@
|
|||||||
|
|
||||||
# Initialize Autoconf
|
# Initialize Autoconf
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
AC_INIT([xlibre-xf86-input-evdev],
|
AC_INIT([xf86-input-evdev],
|
||||||
[25.0.0],
|
[2.9.2],
|
||||||
[https://github.com/X11Libre/xf86-input-evdev/issues],
|
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||||
[xlibre-xf86-input-evdev])
|
[xf86-input-evdev])
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_AUX_DIR(.)
|
AC_CONFIG_AUX_DIR(.)
|
||||||
|
|
||||||
# Initialize Automake
|
# Initialize Automake
|
||||||
AM_INIT_AUTOMAKE([foreign dist-xz])
|
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||||
|
|
||||||
# Initialize libtool
|
# Initialize libtool
|
||||||
AC_DISABLE_STATIC
|
AC_DISABLE_STATIC
|
||||||
@@ -44,22 +44,44 @@ XORG_MACROS_VERSION(1.8)
|
|||||||
XORG_DEFAULT_OPTIONS
|
XORG_DEFAULT_OPTIONS
|
||||||
|
|
||||||
# Obtain compiler/linker options from server and required extensions
|
# Obtain compiler/linker options from server and required extensions
|
||||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 25.0.0] xproto [inputproto >= 2.1.99.3])
|
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto)
|
||||||
PKG_CHECK_MODULES(UDEV, libudev,
|
PKG_CHECK_MODULES(UDEV, libudev)
|
||||||
[HAVE_UDEV=yes], [HAVE_UDEV=no])
|
|
||||||
AS_IF([test "$HAVE_UDEV" = "yes"],
|
|
||||||
[AC_DEFINE([HAVE_LIBUDEV], [1], [Define if libudev is available])])
|
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(XI22, [inputproto >= 2.1.99.3] [xorg-server >= 1.11.99.901], HAVE_XI22="yes", HAVE_XI22="no")
|
||||||
PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
|
PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
|
||||||
PKG_CHECK_MODULES(MTDEV, mtdev)
|
|
||||||
|
if test "x$HAVE_XI22" = xyes; then
|
||||||
|
# Obtain compiler/linker options for mtdev
|
||||||
|
PKG_CHECK_MODULES(MTDEV, mtdev, HAVE_MTDEV="yes", HAVE_MTDEV="no")
|
||||||
|
fi
|
||||||
|
if test "x$HAVE_XI22" = xyes && test "x$HAVE_MTDEV" = xyes; then
|
||||||
|
AC_DEFINE(MULTITOUCH, 1, [XI2.2 available])
|
||||||
|
fi
|
||||||
|
|
||||||
# Define a configure option for an alternate input module directory
|
# Define a configure option for an alternate input module directory
|
||||||
PKG_PROG_PKG_CONFIG([0.25])
|
AC_ARG_WITH(xorg-module-dir,
|
||||||
xlibre_input_drivers_dir=`$PKG_CONFIG --variable=input_drivers_dir xlibre-server`
|
AC_HELP_STRING([--with-xorg-module-dir=DIR],
|
||||||
AC_SUBST(xlibre_input_drivers_dir)
|
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
|
||||||
|
[moduledir="$withval"],
|
||||||
|
[moduledir="$libdir/xorg/modules"])
|
||||||
|
inputdir=${moduledir}/input
|
||||||
|
AC_SUBST(inputdir)
|
||||||
|
|
||||||
xorgconfdir=`$PKG_CONFIG --variable=sysconfigdir xorg-server`
|
# X Server SDK location is required to install evdev header files
|
||||||
AC_SUBST(xorgconfdir)
|
# This location is also relayed in the xorg-evdev.pc file
|
||||||
|
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile man/evdev.man])
|
# Workaround overriding sdkdir to be able to create a tarball when user has no
|
||||||
|
# write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am
|
||||||
|
AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
|
||||||
|
AC_SUBST([sdkdir])
|
||||||
|
|
||||||
|
DRIVER_NAME=evdev
|
||||||
|
AC_SUBST([DRIVER_NAME])
|
||||||
|
|
||||||
|
AC_CONFIG_FILES([Makefile
|
||||||
|
src/Makefile
|
||||||
|
man/Makefile
|
||||||
|
include/Makefile
|
||||||
|
xorg-evdev.pc])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
1
include/Makefile.am
Normal file
1
include/Makefile.am
Normal file
@@ -0,0 +1 @@
|
|||||||
|
sdk_HEADERS = evdev-properties.h
|
||||||
@@ -33,8 +33,6 @@
|
|||||||
#define EVDEV_PROP_MIDBUTTON "Evdev Middle Button Emulation"
|
#define EVDEV_PROP_MIDBUTTON "Evdev Middle Button Emulation"
|
||||||
/* CARD32 */
|
/* CARD32 */
|
||||||
#define EVDEV_PROP_MIDBUTTON_TIMEOUT "Evdev Middle Button Timeout"
|
#define EVDEV_PROP_MIDBUTTON_TIMEOUT "Evdev Middle Button Timeout"
|
||||||
/* CARD8 */
|
|
||||||
#define EVDEV_PROP_MIDBUTTON_BUTTON "Evdev Middle Button Button"
|
|
||||||
|
|
||||||
/* Wheel emulation */
|
/* Wheel emulation */
|
||||||
/* BOOL */
|
/* BOOL */
|
||||||
@@ -56,6 +54,10 @@
|
|||||||
/* BOOL, 2 values [x, y], 1 inverts axis */
|
/* BOOL, 2 values [x, y], 1 inverts axis */
|
||||||
#define EVDEV_PROP_INVERT_AXES "Evdev Axis Inversion"
|
#define EVDEV_PROP_INVERT_AXES "Evdev Axis Inversion"
|
||||||
|
|
||||||
|
/* Reopen attempts. */
|
||||||
|
/* CARD8 */
|
||||||
|
#define EVDEV_PROP_REOPEN "Evdev Reopen Attempts" /* OBSOLETE */
|
||||||
|
|
||||||
/* Run-time calibration */
|
/* Run-time calibration */
|
||||||
/* CARD32, 4 values [minx, maxx, miny, maxy], or no values for unset */
|
/* CARD32, 4 values [minx, maxx, miny, maxy], or no values for unset */
|
||||||
#define EVDEV_PROP_CALIBRATION "Evdev Axis Calibration"
|
#define EVDEV_PROP_CALIBRATION "Evdev Axis Calibration"
|
||||||
|
|||||||
@@ -1,7 +1,37 @@
|
|||||||
|
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
# copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice (including the next
|
||||||
|
# paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
# Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
# DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
|
||||||
drivermandir = $(DRIVER_MAN_DIR)
|
drivermandir = $(DRIVER_MAN_DIR)
|
||||||
driverman_DATA = evdev.$(DRIVER_MAN_SUFFIX)
|
|
||||||
|
driverman_PRE = $(DRIVER_NAME).man
|
||||||
|
|
||||||
|
driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX))
|
||||||
|
|
||||||
|
EXTRA_DIST = $(DRIVER_NAME).man
|
||||||
|
|
||||||
CLEANFILES = $(driverman_DATA)
|
CLEANFILES = $(driverman_DATA)
|
||||||
|
|
||||||
|
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
|
||||||
|
|
||||||
|
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
|
||||||
.man.$(DRIVER_MAN_SUFFIX):
|
.man.$(DRIVER_MAN_SUFFIX):
|
||||||
cp $< $@
|
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
|
||||||
|
|||||||
288
man/evdev.man
Normal file
288
man/evdev.man
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
.\" shorthand for double quote that works everywhere.
|
||||||
|
.ds q \N'34'
|
||||||
|
.TH EVDEV __drivermansuffix__ __vendorversion__
|
||||||
|
.SH NAME
|
||||||
|
evdev \- Generic Linux input driver
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B "Section \*qInputDevice\*q"
|
||||||
|
.BI " Identifier \*q" devname \*q
|
||||||
|
.B " Driver \*qevdev\*q"
|
||||||
|
.BI " Option \*qDevice\*q \*q" devpath \*q
|
||||||
|
.BI " Option \*qEmulate3Buttons\*q \*q" True \*q
|
||||||
|
.BI " Option \*qEmulate3Timeout\*q \*q" 50 \*q
|
||||||
|
.BI " Option \*qGrabDevice\*q \*q" False \*q
|
||||||
|
\ \ ...
|
||||||
|
.B EndSection
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.B evdev
|
||||||
|
is an __xservername__ input driver for Linux\'s generic event devices. It
|
||||||
|
therefore supports all input devices that the kernel knows about, including
|
||||||
|
most mice, keyboards, tablets and touchscreens.
|
||||||
|
.B evdev
|
||||||
|
is the default driver on the major Linux distributions.
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.B evdev
|
||||||
|
driver can serve as both a pointer and a keyboard input device. Multiple
|
||||||
|
input devices are supported by multiple instances of this driver, with one
|
||||||
|
InputDevice section of your __xconfigfile__ for each input device that will
|
||||||
|
use this driver.
|
||||||
|
.PP
|
||||||
|
It is recommended that
|
||||||
|
.B evdev
|
||||||
|
devices are configured through the
|
||||||
|
.B InputClass
|
||||||
|
directive (refer to __xconfigfile__(__filemansuffix__)) instead of manual
|
||||||
|
per-device configuration. Devices configured in the
|
||||||
|
__xconfigfile__(__filemansuffix__) are not hot-plug capable.
|
||||||
|
.PP
|
||||||
|
.SH SUPPORTED HARDWARE
|
||||||
|
In general, any input device that the kernel has a driver for can be accessed
|
||||||
|
through the
|
||||||
|
.B evdev
|
||||||
|
driver. See the Linux kernel documentation for a complete list.
|
||||||
|
.PP
|
||||||
|
.SH CONFIGURATION DETAILS
|
||||||
|
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
|
||||||
|
.B Options
|
||||||
|
are supported:
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qButtonMapping\*q \*q" string \*q
|
||||||
|
Sets the button mapping for this device. The mapping is a space-separated list
|
||||||
|
of button mappings that correspond in order to the physical buttons on the
|
||||||
|
device (i.e. the first number is the mapping for button 1, etc.). The default
|
||||||
|
mapping is "1 2 3 ... 32". A mapping of 0 deactivates the button. Multiple
|
||||||
|
buttons can have the same mapping.
|
||||||
|
For example, a left-handed mouse with deactivated scroll-wheel would use a
|
||||||
|
mapping of "3 2 1 0 0". Invalid mappings are ignored and the default mapping
|
||||||
|
is used. Buttons not specified in the user's mapping use the default mapping.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qDevice\*q \*q" string \*q
|
||||||
|
Specifies the device through which the device can be accessed. This will
|
||||||
|
generally be of the form \*q/dev/input/eventX\*q, where X is some integer.
|
||||||
|
The mapping from device node to hardware is system-dependent. Property:
|
||||||
|
"Device Node" (read-only).
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qDragLockButtons\*q \*q" "L1 B2 L3 B4" \*q
|
||||||
|
Sets \*qdrag lock buttons\*q that simulate holding a button down, so
|
||||||
|
that low dexterity people do not have to hold a button down at the
|
||||||
|
same time they move a mouse cursor. Button numbers occur in pairs,
|
||||||
|
with the lock button number occurring first, followed by the button
|
||||||
|
number that is the target of the lock button. Property: "Evdev
|
||||||
|
Drag Lock Buttons".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qDragLockButtons\*q \*q" "M1" \*q
|
||||||
|
Sets a \*qmaster drag lock button\*q that acts as a \*qMeta Key\*q
|
||||||
|
indicating that the next button pressed is to be
|
||||||
|
\*qdrag locked\*q. Property: "Evdev Drag Lock Buttons".
|
||||||
|
.TP 7
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
|
||||||
|
Enable/disable the emulation of the third (middle) mouse button for mice
|
||||||
|
which only have two physical buttons. The third button is emulated by
|
||||||
|
pressing both buttons simultaneously. Default: off. Property: "Evdev Middle
|
||||||
|
Button Emulation".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
|
||||||
|
Sets the timeout (in milliseconds) that the driver waits before deciding
|
||||||
|
if two buttons where pressed "simultaneously" when 3 button emulation is
|
||||||
|
enabled. Default: 50. Property: "Evdev Middle Button Timeout".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateWheel\*q \*q" boolean \*q
|
||||||
|
Enable/disable "wheel" emulation. Wheel emulation means emulating button
|
||||||
|
press/release events when the mouse is moved while a specific real button
|
||||||
|
is pressed. Wheel button events (typically buttons 4 and 5) are
|
||||||
|
usually used for scrolling. Wheel emulation is useful for getting wheel-like
|
||||||
|
behaviour with trackballs. It can also be useful for mice with 4 or
|
||||||
|
more buttons but no wheel. See the description of the
|
||||||
|
.BR EmulateWheelButton ,
|
||||||
|
.BR EmulateWheelInertia ,
|
||||||
|
.BR EmulateWheelTimeout ,
|
||||||
|
.BR XAxisMapping ,
|
||||||
|
and
|
||||||
|
.B YAxisMapping
|
||||||
|
options. Default: off. Property "Evdev Wheel Emulation".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateWheelButton\*q \*q" integer \*q
|
||||||
|
Specifies which button must be held down to enable wheel emulation mode.
|
||||||
|
While this button is down, X and/or Y pointer movement will generate button
|
||||||
|
press/release events as specified for the
|
||||||
|
.B XAxisMapping
|
||||||
|
and
|
||||||
|
.B YAxisMapping
|
||||||
|
settings. If the button is 0 and
|
||||||
|
.BR EmulateWheel
|
||||||
|
is on, any motion of the device is converted into wheel events. Default: 4.
|
||||||
|
Property: "Evdev Wheel Emulation Button".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q
|
||||||
|
Specifies how far (in pixels) the pointer must move to generate button
|
||||||
|
press/release events in wheel emulation mode. Default: 10. Property: "Evdev
|
||||||
|
Wheel Emulation Inertia".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q
|
||||||
|
Specifies the time in milliseconds the
|
||||||
|
.BR EmulateWheelButton
|
||||||
|
must be pressed before wheel emulation is started. If the
|
||||||
|
.BR EmulateWheelButton
|
||||||
|
is released before this timeout, the original button press/release event
|
||||||
|
is sent. Default: 200. Property: "Evdev Wheel Emulation Timeout".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateThirdButton\*q \*q" boolean \*q
|
||||||
|
Enable third button emulation. Third button emulation emits a right button
|
||||||
|
event (by default) by pressing and holding the first button. The first
|
||||||
|
button must be held down for the configured timeout and must not move more
|
||||||
|
than the configured threshold for the emulation to activate. Otherwise, the
|
||||||
|
first button event is posted as normal. Default: off. Property: "Evdev
|
||||||
|
Third Button Emulation".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateThirdButtonTimeout\*q \*q" integer \*q
|
||||||
|
Specifies the timeout in milliseconds between the initial button press and
|
||||||
|
the generation of the emulated button event.
|
||||||
|
Default: 1000. Property: "Evdev Third Button Emulation Timeout".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateThirdButtonButton\*q \*q" integer \*q
|
||||||
|
Specifies the physical button number to be emitted if third button emulation
|
||||||
|
is triggered.
|
||||||
|
Default: 3. Property: "Evdev Third Button Button".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qEmulateThirdButtonMoveThreshold\*q \*q" integer \*q
|
||||||
|
Specifies the maximum move fuzz in device coordinates for third button
|
||||||
|
emulation. If the device moves by more than this threshold before the third
|
||||||
|
button emulation is triggered, the emulation is cancelled and a first button
|
||||||
|
event is generated as normal.
|
||||||
|
Default: 20. Property: "Evdev Third Button Emulation Threshold".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qGrabDevice\*q \*q" boolean \*q
|
||||||
|
Force a grab on the event device. Doing so will ensure that no other driver
|
||||||
|
can initialise the same device and it will also stop the device from sending
|
||||||
|
events to /dev/kbd or /dev/input/mice. Events from this device will not be
|
||||||
|
sent to virtual devices (e.g. rfkill or the Macintosh mouse button emulation).
|
||||||
|
Default: disabled.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qInvertX\*q \*q" Bool \*q
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qInvertY\*q \*q" Bool \*q
|
||||||
|
Invert the given axis. Default: off. Property: "Evdev Axis Inversion".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q
|
||||||
|
Ignore the specified type of axis. Default: unset. The X server cannot deal
|
||||||
|
with devices that have both relative and absolute axes. Evdev tries to guess
|
||||||
|
wich axes to ignore given the device type and disables absolute axes for
|
||||||
|
mice and relative axes for tablets, touchscreens and touchpad. These options
|
||||||
|
allow to forcibly disable an axis type. Mouse wheel axes are exempt and will
|
||||||
|
work even if relative axes are ignored. No property, this configuration must
|
||||||
|
be set in the configuration.
|
||||||
|
.br
|
||||||
|
If either option is set to False, the driver will not ignore the specified
|
||||||
|
axes regardless of the presence of other axes. This may trigger buggy
|
||||||
|
behavior and events from this axis are always forwarded. Users are
|
||||||
|
discouraged from setting this option.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qCalibration\*q \*q" "min-x max-x min-y max-y" \*q
|
||||||
|
Calibrates the X and Y axes for devices that need to scale to a different
|
||||||
|
coordinate system than reported to the X server. This feature is required
|
||||||
|
for devices that need to scale to a different coordinate system than
|
||||||
|
originally reported by the kernel (e.g. touchscreens). The scaling to the
|
||||||
|
custom coordinate system is done in-driver and the X server is unaware of
|
||||||
|
the transformation. Property: "Evdev Axis Calibration".
|
||||||
|
.TP 7
|
||||||
|
.B Option \*qMode\*q \*qRelative\*q\fP|\fP\*qAbsolute\*q
|
||||||
|
Sets the mode of the device if device has absolute axes.
|
||||||
|
The default value for touchpads is relative, for other absolute.
|
||||||
|
This option has no effect on devices without absolute axes.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qSwapAxes\*q \*q" Bool \*q
|
||||||
|
Swap x/y axes. Default: off. Property: "Evdev Axes Swap".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qXAxisMapping\*q \*q" "N1 N2" \*q
|
||||||
|
Specifies which buttons are mapped to motion in the X direction in wheel
|
||||||
|
emulation mode. Button number
|
||||||
|
.I N1
|
||||||
|
is mapped to the negative X axis motion and button number
|
||||||
|
.I N2
|
||||||
|
is mapped to the positive X axis motion. Default: no mapping. Property:
|
||||||
|
"Evdev Wheel Emulation Axes".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qYAxisMapping\*q \*q" "N1 N2" \*q
|
||||||
|
Specifies which buttons are mapped to motion in the Y direction in wheel
|
||||||
|
emulation mode. Button number
|
||||||
|
.I N1
|
||||||
|
is mapped to the negative Y axis motion and button number
|
||||||
|
.I N2
|
||||||
|
is mapped to the positive Y axis motion. Default: "4 5". Property:
|
||||||
|
"Evdev Wheel Emulation Axes".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qTypeName\*q \*q"type"\*q
|
||||||
|
Specify the X Input 1.x type (see XListInputDevices(__libmansuffix__)).
|
||||||
|
There is rarely a need to use this option, evdev will guess the device type
|
||||||
|
based on the device's capabilities. This option is provided for devices that
|
||||||
|
need quirks.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qVertScrollDelta\*q \*q" integer \*q
|
||||||
|
The amount of motion considered one unit of scrolling vertically.
|
||||||
|
Default: "1". Property: "Evdev Scrolling Distance".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qHorizScrollDelta\*q \*q" integer \*q
|
||||||
|
The amount of motion considered one unit of scrolling horizontally.
|
||||||
|
Default: "1". Property: "Evdev Scrolling Distance".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qDialDelta\*q \*q" integer \*q
|
||||||
|
The amount of motion considered one unit of turning the dial. Default: "1".
|
||||||
|
Property: "Evdev Scrolling Distance".
|
||||||
|
|
||||||
|
.SH SUPPORTED PROPERTIES
|
||||||
|
The following properties are provided by the
|
||||||
|
.B evdev
|
||||||
|
driver.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Axis Calibration"
|
||||||
|
4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable
|
||||||
|
in-driver axis calibration.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Axis Inversion"
|
||||||
|
2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Axes Swap"
|
||||||
|
1 boolean value (8 bit, 0 or 1). 1 swaps x/y axes.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Drag Lock Buttons"
|
||||||
|
8-bit. Either 1 value or pairs of values. Value range 0-32, 0 disables a
|
||||||
|
value.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Middle Button Emulation"
|
||||||
|
1 boolean value (8 bit, 0 or 1).
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Middle Button Timeout"
|
||||||
|
1 16-bit positive value.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Wheel Emulation"
|
||||||
|
1 boolean value (8 bit, 0 or 1).
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Wheel Emulation Axes"
|
||||||
|
4 8-bit values, order X up, X down, Y up, Y down. 0 disables a value.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Wheel Emulation Button"
|
||||||
|
1 8-bit value, allowed range 0-32, 0 disables the button.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Wheel Emulation Inertia"
|
||||||
|
1 16-bit positive value.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Wheel Emulation Timeout"
|
||||||
|
1 16-bit positive value.
|
||||||
|
.TP 7
|
||||||
|
.BI "Evdev Scrolling Distance"
|
||||||
|
3 32-bit values: vertical, horizontal and dial.
|
||||||
|
|
||||||
|
.SH AUTHORS
|
||||||
|
Kristian Høgsberg, Peter Hutterer
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
|
||||||
369
man/evdev.man.in
369
man/evdev.man.in
@@ -1,369 +0,0 @@
|
|||||||
.\" shorthand for double quote that works everywhere.
|
|
||||||
.ds q \N'34'
|
|
||||||
.TH EVDEV @DRIVER_MAN_SUFFIX@ 2016-11-17 "@PACKAGE_STRING@" "X Version 11"
|
|
||||||
.SH NAME
|
|
||||||
evdev \- Generic Linux input driver for XLibre
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.nf
|
|
||||||
.B "Section \*qInputDevice\*q"
|
|
||||||
.BI " Identifier \*q" devname \*q
|
|
||||||
.B " Driver \*qevdev\*q"
|
|
||||||
.BI " Option \*qDevice\*q \*q" devpath \*q
|
|
||||||
.BI " Option \*qEmulate3Buttons\*q \*q" True \*q
|
|
||||||
.BI " Option \*qEmulate3Timeout\*q \*q" 50 \*q
|
|
||||||
.BI " Option \*qGrabDevice\*q \*q" False \*q
|
|
||||||
\ \ ...
|
|
||||||
.B EndSection
|
|
||||||
.fi
|
|
||||||
.SH DESCRIPTION
|
|
||||||
.B evdev
|
|
||||||
is an XLibre input driver for Linux\'s generic event devices.
|
|
||||||
It therefore supports all input devices that the kernel knows about,
|
|
||||||
including most mice, keyboards, tablets, and touchscreens.
|
|
||||||
.B evdev
|
|
||||||
is the default driver on the major Linux distributions.
|
|
||||||
.PP
|
|
||||||
The
|
|
||||||
.B evdev
|
|
||||||
driver can serve as both a pointer and a keyboard input device.
|
|
||||||
Multiple input devices are supported by multiple instances of this driver,
|
|
||||||
with one InputDevice section of your xorg.conf for each input device
|
|
||||||
that will use this driver.
|
|
||||||
.PP
|
|
||||||
It is recommended that
|
|
||||||
.B evdev
|
|
||||||
devices are configured through the
|
|
||||||
.B InputClass
|
|
||||||
directive (refer to
|
|
||||||
.BR xorg.conf (__filemansuffix__))
|
|
||||||
instead of manual per-device configuration.
|
|
||||||
Devices configured in the
|
|
||||||
.BR xorg.conf (__filemansuffix__)
|
|
||||||
are not hot-plug capable.
|
|
||||||
.SH SUPPORTED HARDWARE
|
|
||||||
In general, any input device that the kernel has a driver for can be accessed
|
|
||||||
through the
|
|
||||||
.B evdev
|
|
||||||
driver.
|
|
||||||
See the Linux kernel documentation for a complete list.
|
|
||||||
.SH CONFIGURATION DETAILS
|
|
||||||
Please refer to
|
|
||||||
.BR xorg.conf (__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
|
|
||||||
.B Options
|
|
||||||
are supported:
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qButtonMapping\*q \*q" string \*q
|
|
||||||
Sets the button mapping for this device.
|
|
||||||
The mapping is a space-separated list of button mappings
|
|
||||||
that correspond in order to the physical buttons on the device
|
|
||||||
(i.e. the first number is the mapping for button 1, etc.).
|
|
||||||
The default mapping is "1 2 3 ... 32".
|
|
||||||
A mapping of 0 deactivates the button.
|
|
||||||
Multiple buttons can have the same mapping.
|
|
||||||
For example, a left-handed mouse with deactivated scroll-wheel would use a
|
|
||||||
mapping of "3 2 1 0 0".
|
|
||||||
Invalid mappings are ignored and the default mapping is used.
|
|
||||||
Buttons not specified in the user's mapping use the default mapping.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qDevice\*q \*q" string \*q
|
|
||||||
Specifies the device through which the device can be accessed.
|
|
||||||
This will generally be of the form \*q/dev/input/eventX\*q,
|
|
||||||
where X is some integer.
|
|
||||||
The mapping from device node to hardware is system-dependent.
|
|
||||||
Property: "Device Node" (read-only).
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qDragLockButtons\*q \*q" "L1 B2 L3 B4" \*q
|
|
||||||
Sets \*qdrag lock buttons\*q that simulate holding a button down, so
|
|
||||||
that low dexterity people do not have to hold a button down at the
|
|
||||||
same time they move a mouse cursor.
|
|
||||||
Button numbers occur in pairs,
|
|
||||||
with the lock button number occurring first,
|
|
||||||
followed by the button number that is the target of the lock button.
|
|
||||||
Property: "Evdev
|
|
||||||
Drag Lock Buttons".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qDragLockButtons\*q \*q" "M1" \*q
|
|
||||||
Sets a \*qmaster drag lock button\*q that acts as a \*qMeta Key\*q
|
|
||||||
indicating that the next button pressed is to be \*qdrag locked\*q.
|
|
||||||
Property: "Evdev Drag Lock Buttons".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
|
|
||||||
Enable/disable the emulation of the third (middle) mouse button for mice
|
|
||||||
which only have two physical buttons.
|
|
||||||
The third button is emulated by pressing both buttons simultaneously.
|
|
||||||
Default: off.
|
|
||||||
Property: "Evdev Middle Button Emulation".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
|
|
||||||
Sets the timeout (in milliseconds) that the driver waits before deciding
|
|
||||||
if two buttons were pressed "simultaneously" when 3 button emulation is enabled.
|
|
||||||
Default: 50.
|
|
||||||
Property: "Evdev Middle Button Timeout".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulate3Button\*q \*q" integer \*q
|
|
||||||
Specifies the physical button number to be emitted if middle button emulation
|
|
||||||
is triggered.
|
|
||||||
Default: 2.
|
|
||||||
Property: "Evdev Middle Button Button".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateWheel\*q \*q" boolean \*q
|
|
||||||
Enable/disable "wheel" emulation.
|
|
||||||
Wheel emulation means emulating button press/release events
|
|
||||||
when the mouse is moved while a specific real button is pressed.
|
|
||||||
Wheel button events (typically buttons 4 and 5) are usually used for scrolling.
|
|
||||||
Wheel emulation is useful for getting wheel-like behaviour with trackballs.
|
|
||||||
It can also be useful for mice with 4 or more buttons but no wheel.
|
|
||||||
See the description of the
|
|
||||||
.BR EmulateWheelButton ,
|
|
||||||
.BR EmulateWheelInertia ,
|
|
||||||
.BR EmulateWheelTimeout ,
|
|
||||||
.BR XAxisMapping ,
|
|
||||||
and
|
|
||||||
.B YAxisMapping
|
|
||||||
options.
|
|
||||||
Default: off.
|
|
||||||
Property: "Evdev Wheel Emulation".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateWheelButton\*q \*q" integer \*q
|
|
||||||
Specifies which button must be held down to enable wheel emulation mode.
|
|
||||||
While this button is down, X and/or Y pointer movement will generate button
|
|
||||||
press/release events as specified for the
|
|
||||||
.B XAxisMapping
|
|
||||||
and
|
|
||||||
.B YAxisMapping
|
|
||||||
settings.
|
|
||||||
If the button is 0 and
|
|
||||||
.B EmulateWheel
|
|
||||||
is on, any motion of the device is converted into wheel events.
|
|
||||||
Default: 4.
|
|
||||||
Property: "Evdev Wheel Emulation Button".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q
|
|
||||||
Specifies how far (in pixels) the pointer must move to generate button
|
|
||||||
press/release events in wheel emulation mode.
|
|
||||||
Default: 10.
|
|
||||||
Property: "Evdev Wheel Emulation Inertia".
|
|
||||||
.IP
|
|
||||||
This value must be set for any device does not resemble a standard mouse.
|
|
||||||
Specifically, on absolute devices such as tablets the value should be set to
|
|
||||||
a reasonable fraction of the expected movement to avoid excess scroll events.
|
|
||||||
.IP
|
|
||||||
.B WARNING:
|
|
||||||
the name \*qinertia\*q is a misnomer.
|
|
||||||
This option defines the distance required to generate one scroll event
|
|
||||||
similar to the
|
|
||||||
.B VertScrollDelta
|
|
||||||
and
|
|
||||||
.B HorizScrollDelta
|
|
||||||
options.
|
|
||||||
It does not enable inertia in the physical sense,
|
|
||||||
scrolling stops immediately once the movement has stopped.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q
|
|
||||||
Specifies the time in milliseconds the
|
|
||||||
.B EmulateWheelButton
|
|
||||||
must be pressed before wheel emulation is started.
|
|
||||||
If the
|
|
||||||
.B EmulateWheelButton
|
|
||||||
is released before this timeout,
|
|
||||||
the original button press/release event is sent.
|
|
||||||
Default: 200.
|
|
||||||
Property: "Evdev Wheel Emulation Timeout".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateThirdButton\*q \*q" boolean \*q
|
|
||||||
Enable third button emulation.
|
|
||||||
Third button emulation emits a right button event (by default)
|
|
||||||
by pressing and holding the first button.
|
|
||||||
The first button must be held down for the configured timeout and
|
|
||||||
must not move more than the configured threshold for the emulation to activate.
|
|
||||||
Otherwise, the first button event is posted as normal.
|
|
||||||
Default: off.
|
|
||||||
Property: "Evdev Third Button Emulation".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateThirdButtonTimeout\*q \*q" integer \*q
|
|
||||||
Specifies the timeout in milliseconds between the initial button press and
|
|
||||||
the generation of the emulated button event.
|
|
||||||
Default: 1000.
|
|
||||||
Property: "Evdev Third Button Emulation Timeout".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateThirdButtonButton\*q \*q" integer \*q
|
|
||||||
Specifies the physical button number to be emitted if third button emulation
|
|
||||||
is triggered.
|
|
||||||
Default: 3.
|
|
||||||
Property: "Evdev Third Button Button".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qEmulateThirdButtonMoveThreshold\*q \*q" integer \*q
|
|
||||||
Specifies the maximum move fuzz in device coordinates for third button
|
|
||||||
emulation.
|
|
||||||
If the device moves by more than this threshold before the third
|
|
||||||
button emulation is triggered, the emulation is cancelled and a first button
|
|
||||||
event is generated as normal.
|
|
||||||
Default: 20.
|
|
||||||
Property: "Evdev Third Button Emulation Threshold".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qGrabDevice\*q \*q" boolean \*q
|
|
||||||
Force a grab on the event device.
|
|
||||||
Doing so will ensure that no other driver
|
|
||||||
can initialise the same device and it will also stop the device from sending
|
|
||||||
events to /dev/kbd or /dev/input/mice.
|
|
||||||
Events from this device will not be sent to virtual devices
|
|
||||||
(e.g. rfkill or the Macintosh mouse button emulation).
|
|
||||||
Default: disabled.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qInvertX\*q \*q" Bool \*q
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qInvertY\*q \*q" Bool \*q
|
|
||||||
Invert the given axis.
|
|
||||||
Default: off.
|
|
||||||
Property: "Evdev Axis Inversion".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q
|
|
||||||
Ignore the specified type of axis.
|
|
||||||
Default: unset.
|
|
||||||
The X server cannot deal with devices that have both relative and absolute axes.
|
|
||||||
Evdev tries to guess which axes to ignore given the device type and
|
|
||||||
disables absolute axes for mice and relative axes for tablets, touchscreens,
|
|
||||||
and touchpad.
|
|
||||||
These options allow to forcibly disable an axis type.
|
|
||||||
Mouse wheel axes are exempt and will work even if relative axes are ignored.
|
|
||||||
No property, this configuration must be set in the configuration.
|
|
||||||
.br
|
|
||||||
If either option is set to False, the driver will not ignore the specified
|
|
||||||
axes regardless of the presence of other axes.
|
|
||||||
This may trigger buggy behavior and events from this axis are always forwarded.
|
|
||||||
Users are discouraged from setting this option.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qCalibration\*q \*q" "min-x max-x min-y max-y" \*q
|
|
||||||
Calibrates the X and Y axes for devices that need to scale to a different
|
|
||||||
coordinate system than reported to the X server.
|
|
||||||
This feature is required for devices that need to scale to
|
|
||||||
a different coordinate system than originally reported by the kernel
|
|
||||||
(e.g. touchscreens).
|
|
||||||
The scaling to the custom coordinate system is done in-driver and
|
|
||||||
the X server is unaware of the transformation.
|
|
||||||
Property: "Evdev Axis Calibration".
|
|
||||||
.TP 7
|
|
||||||
.B Option \*qMode\*q \*qRelative\*q\fP|\fP\*qAbsolute\*q
|
|
||||||
Sets the mode of the device if device has absolute axes.
|
|
||||||
The default value for touchpads is relative, for other absolute.
|
|
||||||
This option has no effect on devices without absolute axes.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qSwapAxes\*q \*q" Bool \*q
|
|
||||||
Swap x/y axes.
|
|
||||||
Default: off.
|
|
||||||
Property: "Evdev Axes Swap".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qXAxisMapping\*q \*q" "N1 N2" \*q
|
|
||||||
Specifies which buttons are mapped to motion in the X direction in wheel
|
|
||||||
emulation mode.
|
|
||||||
Button number
|
|
||||||
.I N1
|
|
||||||
is mapped to the negative X axis motion and button number
|
|
||||||
.I N2
|
|
||||||
is mapped to the positive X axis motion.
|
|
||||||
Default: no mapping.
|
|
||||||
Property: "Evdev Wheel Emulation Axes".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qYAxisMapping\*q \*q" "N1 N2" \*q
|
|
||||||
Specifies which buttons are mapped to motion in the Y direction in wheel
|
|
||||||
emulation mode.
|
|
||||||
Button number
|
|
||||||
.I N1
|
|
||||||
is mapped to the negative Y axis motion and button number
|
|
||||||
.I N2
|
|
||||||
is mapped to the positive Y axis motion.
|
|
||||||
Default: "4 5".
|
|
||||||
Property: "Evdev Wheel Emulation Axes".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qTypeName\*q" \*q"type"\*q
|
|
||||||
Specify the X Input 1.x type (see
|
|
||||||
.BR XListInputDevices (__libmansuffix__)).
|
|
||||||
There is rarely a need to use this option, evdev will guess the device type
|
|
||||||
based on the device's capabilities.
|
|
||||||
This option is provided for devices that need quirks.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qVertScrollDelta\*q \*q" integer \*q
|
|
||||||
The amount of motion considered one unit of scrolling vertically.
|
|
||||||
Default: "1".
|
|
||||||
Property: "Evdev Scrolling Distance".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qHorizScrollDelta\*q \*q" integer \*q
|
|
||||||
The amount of motion considered one unit of scrolling horizontally.
|
|
||||||
Default: "1".
|
|
||||||
Property: "Evdev Scrolling Distance".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qDialDelta\*q \*q" integer \*q
|
|
||||||
The amount of motion considered one unit of turning the dial.
|
|
||||||
Default: "1".
|
|
||||||
Property: "Evdev Scrolling Distance".
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qResolution\*q \*q" integer \*q
|
|
||||||
Sets the resolution of the device in dots per inch.
|
|
||||||
The resolution is used to scale relative motion events from mouse devices to
|
|
||||||
1000 DPI resolution.
|
|
||||||
This can be used to make high resolution mice less sensitive without turning off
|
|
||||||
acceleration.
|
|
||||||
If set to 0 no scaling will be performed.
|
|
||||||
Default: "0".
|
|
||||||
.SH SUPPORTED PROPERTIES
|
|
||||||
The following properties are provided by the
|
|
||||||
.B evdev
|
|
||||||
driver.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Axis Calibration"
|
|
||||||
4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable
|
|
||||||
in-driver axis calibration.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Axis Inversion"
|
|
||||||
2 boolean values (8 bit, 0 or 1), order X, Y.
|
|
||||||
1 inverts the axis.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Axes Swap"
|
|
||||||
1 boolean value (8 bit, 0 or 1).
|
|
||||||
1 swaps x/y axes.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Drag Lock Buttons"
|
|
||||||
8-bit. Either 1 value or pairs of values.
|
|
||||||
Value range 0-32, 0 disables a value.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Middle Button Emulation"
|
|
||||||
1 boolean value (8 bit, 0 or 1).
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Middle Button Timeout"
|
|
||||||
1 16-bit positive value.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Middle Button Button"
|
|
||||||
1 8-bit value, allowed range 0-32, 0 disables the button.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Wheel Emulation"
|
|
||||||
1 boolean value (8 bit, 0 or 1).
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Wheel Emulation Axes"
|
|
||||||
4 8-bit values, order X up, X down, Y up, Y down.
|
|
||||||
0 disables a value.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Wheel Emulation Button"
|
|
||||||
1 8-bit value, allowed range 0-32, 0 disables the button.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Wheel Emulation Inertia"
|
|
||||||
1 16-bit positive value.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Wheel Emulation Timeout"
|
|
||||||
1 16-bit positive value.
|
|
||||||
.TP 7
|
|
||||||
.B "Evdev Scrolling Distance"
|
|
||||||
3 32-bit values: vertical, horizontal and dial.
|
|
||||||
.SH AUTHORS
|
|
||||||
Kristian Høgsberg, Peter Hutterer
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
.BR XLibre (@APP_MAN_SUFFIX@),
|
|
||||||
.BR xorg.conf (@FILE_MAN_SUFFIX@),
|
|
||||||
.BR Xserver (@APP_MAN_SUFFIX@),
|
|
||||||
.BR X (@MISC_MAN_SUFFIX@)
|
|
||||||
@@ -28,16 +28,17 @@
|
|||||||
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
|
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
|
||||||
AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBEVDEV_CFLAGS)
|
AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBEVDEV_CFLAGS)
|
||||||
|
|
||||||
evdev_drv_la_LTLIBRARIES = evdev_drv.la
|
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
|
||||||
evdev_drv_la_LDFLAGS = -module -avoid-version
|
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
|
||||||
evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) $(LIBEVDEV_LIBS)
|
@DRIVER_NAME@_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||||
evdev_drv_ladir = @xlibre_input_drivers_dir@
|
@DRIVER_NAME@_drv_ladir = @inputdir@
|
||||||
|
|
||||||
evdev_drv_la_SOURCES = evdev.c \
|
@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c \
|
||||||
evdev.h \
|
@DRIVER_NAME@.h \
|
||||||
emuMB.c \
|
emuMB.c \
|
||||||
emuThird.c \
|
emuThird.c \
|
||||||
emuWheel.c \
|
emuWheel.c \
|
||||||
draglock.c \
|
draglock.c \
|
||||||
apple.c \
|
apple.c \
|
||||||
axis_labels.h
|
axis_labels.h
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,9 @@
|
|||||||
* Peter Hutterer (peter.hutterer@redhat.com)
|
* Peter Hutterer (peter.hutterer@redhat.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <evdev.h>
|
#include <evdev.h>
|
||||||
#include <evdev-properties.h>
|
#include <evdev-properties.h>
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <xserver-properties.h>
|
#include <xserver-properties.h>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* Copyright 1994-2002 by The XFree86 Project, Inc.
|
* Copyright 1994-2002 by The XFree86 Project, Inc.
|
||||||
* Copyright 2002 by Paul Elliott
|
* Copyright 2002 by Paul Elliott
|
||||||
* (Ported from xf86-input-mouse, above copyrights taken from there)
|
* (Ported from xf86-input-mouse, above copyrights taken from there)
|
||||||
* Copyright © 2008 University of South Australia
|
* Copyright © 2008 University of South Australia
|
||||||
* Copyright 2008 by Chris Salch
|
* Copyright 2008 by Chris Salch
|
||||||
* Copyright 2008 Red Hat, Inc.
|
* Copyright 2008 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,9 @@
|
|||||||
|
|
||||||
/* Draglock code */
|
/* Draglock code */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
#include "evdev.h"
|
#include "evdev.h"
|
||||||
|
|
||||||
#include <xf86.h>
|
#include <xf86.h>
|
||||||
|
|||||||
67
src/emuMB.c
67
src/emuMB.c
@@ -30,7 +30,10 @@
|
|||||||
|
|
||||||
/* Middle mouse button emulation code. */
|
/* Middle mouse button emulation code. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "evdev.h"
|
#include "evdev.h"
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
@@ -42,7 +45,6 @@
|
|||||||
|
|
||||||
static Atom prop_mbemu = 0; /* Middle button emulation on/off property */
|
static Atom prop_mbemu = 0; /* Middle button emulation on/off property */
|
||||||
static Atom prop_mbtimeout = 0; /* Middle button timeout property */
|
static Atom prop_mbtimeout = 0; /* Middle button timeout property */
|
||||||
static Atom prop_mbbuton = 0; /* Middle button target button property */
|
|
||||||
/*
|
/*
|
||||||
* Lets create a simple finite-state machine for 3 button emulation:
|
* Lets create a simple finite-state machine for 3 button emulation:
|
||||||
*
|
*
|
||||||
@@ -182,17 +184,14 @@ int
|
|||||||
EvdevMBEmuTimer(InputInfoPtr pInfo)
|
EvdevMBEmuTimer(InputInfoPtr pInfo)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
int sigstate;
|
||||||
int id;
|
int id;
|
||||||
int mapped_id;
|
|
||||||
|
|
||||||
input_lock();
|
sigstate = xf86BlockSIGIO ();
|
||||||
|
|
||||||
pEvdev->emulateMB.pending = FALSE;
|
pEvdev->emulateMB.pending = FALSE;
|
||||||
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
|
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
|
||||||
mapped_id = abs(id);
|
EvdevPostButtonEvent(pInfo, abs(id),
|
||||||
if (mapped_id == 2)
|
|
||||||
mapped_id = pEvdev->emulateMB.button;
|
|
||||||
EvdevPostButtonEvent(pInfo, mapped_id,
|
|
||||||
(id >= 0) ? BUTTON_PRESS : BUTTON_RELEASE);
|
(id >= 0) ? BUTTON_PRESS : BUTTON_RELEASE);
|
||||||
pEvdev->emulateMB.state =
|
pEvdev->emulateMB.state =
|
||||||
stateTab[pEvdev->emulateMB.state][4][2];
|
stateTab[pEvdev->emulateMB.state][4][2];
|
||||||
@@ -201,7 +200,7 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
|
|||||||
pEvdev->emulateMB.state);
|
pEvdev->emulateMB.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
input_unlock();
|
xf86UnblockSIGIO (sigstate);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +219,6 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
|
|||||||
{
|
{
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
int id;
|
int id;
|
||||||
int mapped_id;
|
|
||||||
int *btstate;
|
int *btstate;
|
||||||
int ret = FALSE;
|
int ret = FALSE;
|
||||||
|
|
||||||
@@ -239,10 +237,7 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
|
|||||||
|
|
||||||
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][0]) != 0)
|
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][0]) != 0)
|
||||||
{
|
{
|
||||||
mapped_id = abs(id);
|
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
|
||||||
if (mapped_id == 2)
|
|
||||||
mapped_id = pEvdev->emulateMB.button;
|
|
||||||
EvdevQueueButtonEvent(pInfo, mapped_id, (id >= 0));
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][1]) != 0)
|
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][1]) != 0)
|
||||||
@@ -266,7 +261,9 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EvdevMBEmuWakeupHandler(void *data, int i)
|
void EvdevMBEmuWakeupHandler(pointer data,
|
||||||
|
int i,
|
||||||
|
pointer LastSelectMask)
|
||||||
{
|
{
|
||||||
InputInfoPtr pInfo = (InputInfoPtr)data;
|
InputInfoPtr pInfo = (InputInfoPtr)data;
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
@@ -280,7 +277,9 @@ void EvdevMBEmuWakeupHandler(void *data, int i)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EvdevMBEmuBlockHandler(void *data, void *waitTime)
|
void EvdevMBEmuBlockHandler(pointer data,
|
||||||
|
struct timeval **waitTime,
|
||||||
|
pointer LastSelectMask)
|
||||||
{
|
{
|
||||||
InputInfoPtr pInfo = (InputInfoPtr) data;
|
InputInfoPtr pInfo = (InputInfoPtr) data;
|
||||||
EvdevPtr pEvdev= (EvdevPtr) pInfo->private;
|
EvdevPtr pEvdev= (EvdevPtr) pInfo->private;
|
||||||
@@ -299,23 +298,12 @@ void
|
|||||||
EvdevMBEmuPreInit(InputInfoPtr pInfo)
|
EvdevMBEmuPreInit(InputInfoPtr pInfo)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
int bt;
|
|
||||||
|
|
||||||
pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options,
|
pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options,
|
||||||
"Emulate3Buttons",
|
"Emulate3Buttons",
|
||||||
FALSE);
|
FALSE);
|
||||||
pEvdev->emulateMB.timeout = xf86SetIntOption(pInfo->options,
|
pEvdev->emulateMB.timeout = xf86SetIntOption(pInfo->options,
|
||||||
"Emulate3Timeout", 50);
|
"Emulate3Timeout", 50);
|
||||||
bt = xf86SetIntOption(pInfo->options, "Emulate3Button", 2);
|
|
||||||
if (bt < 0 || bt > EVDEV_MAXBUTTONS) {
|
|
||||||
xf86IDrvMsg(pInfo, X_WARNING, "Invalid Emulate3Button value: %d\n",
|
|
||||||
bt);
|
|
||||||
xf86IDrvMsg(pInfo, X_WARNING, "Middle button emulation disabled.\n");
|
|
||||||
|
|
||||||
pEvdev->emulateMB.enabled = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pEvdev->emulateMB.button = bt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -326,7 +314,7 @@ EvdevMBEmuOn(InputInfoPtr pInfo)
|
|||||||
|
|
||||||
RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
|
RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
|
||||||
EvdevMBEmuWakeupHandler,
|
EvdevMBEmuWakeupHandler,
|
||||||
(void*)pInfo);
|
(pointer)pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -337,7 +325,7 @@ EvdevMBEmuFinalize(InputInfoPtr pInfo)
|
|||||||
|
|
||||||
RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
|
RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
|
||||||
EvdevMBEmuWakeupHandler,
|
EvdevMBEmuWakeupHandler,
|
||||||
(void*)pInfo);
|
(pointer)pInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +335,6 @@ EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
|||||||
{
|
{
|
||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
int bt;
|
|
||||||
|
|
||||||
if (atom == prop_mbemu)
|
if (atom == prop_mbemu)
|
||||||
{
|
{
|
||||||
@@ -363,18 +350,6 @@ EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
|||||||
|
|
||||||
if (!checkonly)
|
if (!checkonly)
|
||||||
pEvdev->emulateMB.timeout = *((CARD32*)val->data);
|
pEvdev->emulateMB.timeout = *((CARD32*)val->data);
|
||||||
} else if (atom == prop_mbbuton)
|
|
||||||
{
|
|
||||||
if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
|
|
||||||
return BadMatch;
|
|
||||||
|
|
||||||
bt = *((CARD8*)val->data);
|
|
||||||
|
|
||||||
if (bt < 0 || bt > EVDEV_MAXBUTTONS)
|
|
||||||
return BadValue;
|
|
||||||
|
|
||||||
if (!checkonly)
|
|
||||||
pEvdev->emulateMB.button = bt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
@@ -412,15 +387,5 @@ EvdevMBEmuInitProperty(DeviceIntPtr dev)
|
|||||||
return;
|
return;
|
||||||
XISetDevicePropertyDeletable(dev, prop_mbtimeout, FALSE);
|
XISetDevicePropertyDeletable(dev, prop_mbtimeout, FALSE);
|
||||||
|
|
||||||
prop_mbbuton = MakeAtom(EVDEV_PROP_MIDBUTTON_BUTTON,
|
|
||||||
strlen(EVDEV_PROP_MIDBUTTON_BUTTON),
|
|
||||||
TRUE);
|
|
||||||
rc = XIChangeDeviceProperty(dev, prop_mbbuton, XA_INTEGER, 8, PropModeReplace, 1,
|
|
||||||
&pEvdev->emulateMB.button, FALSE);
|
|
||||||
|
|
||||||
if (rc != Success)
|
|
||||||
return;
|
|
||||||
XISetDevicePropertyDeletable(dev, prop_mbbuton, FALSE);
|
|
||||||
|
|
||||||
XIRegisterPropertyHandler(dev, EvdevMBEmuSetProperty, NULL, NULL);
|
XIRegisterPropertyHandler(dev, EvdevMBEmuSetProperty, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,10 @@
|
|||||||
* generated.
|
* generated.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "evdev.h"
|
#include "evdev.h"
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
@@ -81,16 +84,17 @@ Evdev3BEmuPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act)
|
|||||||
* @param arg The InputInfoPtr for this device.
|
* @param arg The InputInfoPtr for this device.
|
||||||
*/
|
*/
|
||||||
CARD32
|
CARD32
|
||||||
Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, void *arg)
|
Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg)
|
||||||
{
|
{
|
||||||
InputInfoPtr pInfo = (InputInfoPtr)arg;
|
InputInfoPtr pInfo = (InputInfoPtr)arg;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
||||||
|
int sigstate = 0;
|
||||||
|
|
||||||
input_lock();
|
sigstate = xf86BlockSIGIO ();
|
||||||
emu3B->state = EM3B_EMULATING;
|
emu3B->state = EM3B_EMULATING;
|
||||||
Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
|
Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
|
||||||
input_unlock();
|
xf86UnblockSIGIO (sigstate);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,8 +229,8 @@ Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals)
|
|||||||
{
|
{
|
||||||
if (valuator_mask_isset(vals, axis))
|
if (valuator_mask_isset(vals, axis))
|
||||||
{
|
{
|
||||||
double delta = valuator_mask_get_double(vals, axis) - emu3B->startpos[axis];
|
int delta = valuator_mask_get(vals, axis) - emu3B->startpos[axis];
|
||||||
if (fabs(delta) > emu3B->threshold)
|
if (abs(delta) > emu3B->threshold)
|
||||||
cancel = TRUE;
|
cancel = TRUE;
|
||||||
}
|
}
|
||||||
axis++;
|
axis++;
|
||||||
@@ -244,7 +248,7 @@ Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals)
|
|||||||
* emulation.
|
* emulation.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy)
|
Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
||||||
@@ -256,8 +260,8 @@ Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy)
|
|||||||
emu3B->delta[1] += dy;
|
emu3B->delta[1] += dy;
|
||||||
emu3B->flags |= EVDEV_RELATIVE_EVENTS;
|
emu3B->flags |= EVDEV_RELATIVE_EVENTS;
|
||||||
|
|
||||||
if (fabs(emu3B->delta[0]) > emu3B->threshold ||
|
if (abs(emu3B->delta[0]) > emu3B->threshold ||
|
||||||
fabs(emu3B->delta[1]) > emu3B->threshold)
|
abs(emu3B->delta[1]) > emu3B->threshold)
|
||||||
{
|
{
|
||||||
Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
|
Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
|
||||||
Evdev3BCancel(pInfo);
|
Evdev3BCancel(pInfo);
|
||||||
|
|||||||
@@ -30,7 +30,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Mouse wheel emulation code. */
|
/* Mouse wheel emulation code. */
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
#include "evdev.h"
|
#include "evdev.h"
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
@@ -48,7 +50,7 @@ static Atom prop_wheel_inertia = 0;
|
|||||||
static Atom prop_wheel_timeout = 0;
|
static Atom prop_wheel_timeout = 0;
|
||||||
static Atom prop_wheel_button = 0;
|
static Atom prop_wheel_button = 0;
|
||||||
|
|
||||||
/* Local Function Prototypes */
|
/* Local Funciton Prototypes */
|
||||||
static int EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value);
|
static int EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value);
|
||||||
|
|
||||||
/* Filter mouse button events */
|
/* Filter mouse button events */
|
||||||
@@ -93,7 +95,7 @@ BOOL
|
|||||||
EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
WheelAxisPtr pAxis = NULL;
|
WheelAxisPtr pAxis = NULL, pOtherAxis = NULL;
|
||||||
int value = pEv->value;
|
int value = pEv->value;
|
||||||
|
|
||||||
/* Has wheel emulation been configured to be enabled? */
|
/* Has wheel emulation been configured to be enabled? */
|
||||||
@@ -117,7 +119,7 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
int oldValue;
|
int oldValue;
|
||||||
|
|
||||||
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) {
|
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) {
|
||||||
valuator_mask_set(pEvdev->abs_vals, axis, value);
|
valuator_mask_set(pEvdev->vals, axis, value);
|
||||||
value -= oldValue; /* make value into a differential measurement */
|
value -= oldValue; /* make value into a differential measurement */
|
||||||
} else
|
} else
|
||||||
value = 0; /* avoid a jump on the first touch */
|
value = 0; /* avoid a jump on the first touch */
|
||||||
@@ -128,11 +130,13 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
/* ABS_X has the same value as REL_X, so this case catches both */
|
/* ABS_X has the same value as REL_X, so this case catches both */
|
||||||
case REL_X:
|
case REL_X:
|
||||||
pAxis = &(pEvdev->emulateWheel.X);
|
pAxis = &(pEvdev->emulateWheel.X);
|
||||||
|
pOtherAxis = &(pEvdev->emulateWheel.Y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* ABS_Y has the same value as REL_Y, so this case catches both */
|
/* ABS_Y has the same value as REL_Y, so this case catches both */
|
||||||
case REL_Y:
|
case REL_Y:
|
||||||
pAxis = &(pEvdev->emulateWheel.Y);
|
pAxis = &(pEvdev->emulateWheel.Y);
|
||||||
|
pOtherAxis = &(pEvdev->emulateWheel.X);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -140,10 +144,15 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
|
/* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
|
||||||
wheel.
|
wheel. Reset the inertia of the other axis when a scroll event
|
||||||
|
was sent to avoid the buildup of erroneous scroll events if the
|
||||||
|
user doesn't move in a perfectly straight line.
|
||||||
*/
|
*/
|
||||||
if (pAxis)
|
if (pAxis)
|
||||||
EvdevWheelEmuInertia(pInfo, pAxis, value);
|
{
|
||||||
|
if (EvdevWheelEmuInertia(pInfo, pAxis, value))
|
||||||
|
pOtherAxis->traveled_distance = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Eat motion events while emulateWheel button pressed. */
|
/* Eat motion events while emulateWheel button pressed. */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -208,7 +217,9 @@ EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis,
|
|||||||
((up_button > 0) && (up_button <= EVDEV_MAXBUTTONS)) &&
|
((up_button > 0) && (up_button <= EVDEV_MAXBUTTONS)) &&
|
||||||
((down_button > 0) && (down_button <= EVDEV_MAXBUTTONS))) {
|
((down_button > 0) && (down_button <= EVDEV_MAXBUTTONS))) {
|
||||||
|
|
||||||
msg = strdup("buttons XX and YY");
|
/* Use xstrdup to allocate a string for us */
|
||||||
|
msg = xstrdup("buttons XX and YY");
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
sprintf(msg, "buttons %d and %d", up_button, down_button);
|
sprintf(msg, "buttons %d and %d", up_button, down_button);
|
||||||
|
|
||||||
|
|||||||
600
src/evdev.c
600
src/evdev.c
File diff suppressed because it is too large
Load Diff
54
src/evdev.h
54
src/evdev.h
@@ -28,27 +28,24 @@
|
|||||||
* Oliver McFadden (oliver.mcfadden@nokia.com)
|
* Oliver McFadden (oliver.mcfadden@nokia.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef EVDEV_H
|
#ifndef EVDEV_H
|
||||||
#define EVDEV_H
|
#define EVDEV_H
|
||||||
|
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <sys/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
/* Tolerate prior #include <linux/input.h> */
|
|
||||||
#undef BUS_NONE
|
|
||||||
#undef BUS_PCI
|
|
||||||
#undef BUS_SBUS
|
|
||||||
#undef BUS_PLATFORM
|
|
||||||
#undef BUS_USB
|
|
||||||
|
|
||||||
#include <xorg-server.h>
|
#include <xorg-server.h>
|
||||||
#include <xf86Xinput.h>
|
#include <xf86Xinput.h>
|
||||||
#include <xf86_OSproc.h>
|
#include <xf86_OSproc.h>
|
||||||
#include <xkbstr.h>
|
#include <xkbstr.h>
|
||||||
|
|
||||||
|
#ifdef MULTITOUCH
|
||||||
#include <mtdev.h>
|
#include <mtdev.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <libevdev/libevdev.h>
|
#include <libevdev/libevdev.h>
|
||||||
|
|
||||||
@@ -68,6 +65,14 @@
|
|||||||
#define LED_CNT (LED_MAX+1)
|
#define LED_CNT (LED_MAX+1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
|
||||||
|
#define HAVE_SMOOTH_SCROLLING 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18
|
||||||
|
#define LogMessageVerbSigSafe xf86MsgVerb
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EVDEV_MAXBUTTONS 32
|
#define EVDEV_MAXBUTTONS 32
|
||||||
#define EVDEV_MAXQUEUE 32
|
#define EVDEV_MAXQUEUE 32
|
||||||
|
|
||||||
@@ -98,8 +103,6 @@
|
|||||||
/* Number of longs needed to hold the given number of bits */
|
/* Number of longs needed to hold the given number of bits */
|
||||||
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
|
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
|
||||||
|
|
||||||
#define DEFAULT_MOUSE_DPI 1000.0
|
|
||||||
|
|
||||||
/* Function key mode */
|
/* Function key mode */
|
||||||
enum fkeymode {
|
enum fkeymode {
|
||||||
FKEYMODE_UNKNOWN = 0,
|
FKEYMODE_UNKNOWN = 0,
|
||||||
@@ -132,14 +135,20 @@ typedef struct {
|
|||||||
EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */
|
EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */
|
||||||
EV_QUEUE_BTN, /* xf86PostButtonEvent() */
|
EV_QUEUE_BTN, /* xf86PostButtonEvent() */
|
||||||
EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
|
EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
|
||||||
|
#ifdef MULTITOUCH
|
||||||
EV_QUEUE_TOUCH, /*xf86PostTouchEvent() */
|
EV_QUEUE_TOUCH, /*xf86PostTouchEvent() */
|
||||||
|
#endif
|
||||||
} type;
|
} type;
|
||||||
union {
|
union {
|
||||||
int key; /* May be either a key code or button number. */
|
int key; /* May be either a key code or button number. */
|
||||||
|
#ifdef MULTITOUCH
|
||||||
unsigned int touch; /* Touch ID */
|
unsigned int touch; /* Touch ID */
|
||||||
|
#endif
|
||||||
} detail;
|
} detail;
|
||||||
int val; /* State of the key/button/touch; pressed or released. */
|
int val; /* State of the key/button/touch; pressed or released. */
|
||||||
|
#ifdef MULTITOUCH
|
||||||
ValuatorMask *touchMask;
|
ValuatorMask *touchMask;
|
||||||
|
#endif
|
||||||
} EventQueueRec, *EventQueuePtr;
|
} EventQueueRec, *EventQueuePtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -152,10 +161,9 @@ typedef struct {
|
|||||||
int num_mt_vals; /* number of multitouch valuators */
|
int num_mt_vals; /* number of multitouch valuators */
|
||||||
int abs_axis_map[ABS_CNT]; /* Map evdev ABS_* to index */
|
int abs_axis_map[ABS_CNT]; /* Map evdev ABS_* to index */
|
||||||
int rel_axis_map[REL_CNT]; /* Map evdev REL_* to index */
|
int rel_axis_map[REL_CNT]; /* Map evdev REL_* to index */
|
||||||
ValuatorMask *abs_vals; /* values for absolute axis */
|
ValuatorMask *vals; /* new values coming in */
|
||||||
ValuatorMask *rel_vals; /* values for relative axis */
|
ValuatorMask *old_vals; /* old values for calculating relative motion */
|
||||||
ValuatorMask *old_vals; /* old absolute values for calculating relative motion */
|
ValuatorMask *prox; /* last values set while not in proximity */
|
||||||
ValuatorMask *prox; /* last absolute values set while not in proximity */
|
|
||||||
ValuatorMask *mt_mask;
|
ValuatorMask *mt_mask;
|
||||||
ValuatorMask **last_mt_vals;
|
ValuatorMask **last_mt_vals;
|
||||||
int cur_slot;
|
int cur_slot;
|
||||||
@@ -163,8 +171,9 @@ typedef struct {
|
|||||||
int dirty;
|
int dirty;
|
||||||
enum SlotState state;
|
enum SlotState state;
|
||||||
} *slots;
|
} *slots;
|
||||||
|
#ifdef MULTITOUCH
|
||||||
struct mtdev *mtdev;
|
struct mtdev *mtdev;
|
||||||
BOOL fake_mt;
|
#endif
|
||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
int in_proximity; /* device in proximity */
|
int in_proximity; /* device in proximity */
|
||||||
@@ -173,8 +182,8 @@ typedef struct {
|
|||||||
BOOL swap_axes;
|
BOOL swap_axes;
|
||||||
BOOL invert_x;
|
BOOL invert_x;
|
||||||
BOOL invert_y;
|
BOOL invert_y;
|
||||||
int resolution;
|
|
||||||
|
|
||||||
|
int delta[REL_CNT];
|
||||||
unsigned int abs_queued, rel_queued, prox_queued;
|
unsigned int abs_queued, rel_queued, prox_queued;
|
||||||
|
|
||||||
/* Middle mouse button emulation */
|
/* Middle mouse button emulation */
|
||||||
@@ -185,7 +194,6 @@ typedef struct {
|
|||||||
int state; /* state machine (see bt3emu.c) */
|
int state; /* state machine (see bt3emu.c) */
|
||||||
Time expires; /* time of expiry */
|
Time expires; /* time of expiry */
|
||||||
Time timeout;
|
Time timeout;
|
||||||
uint8_t button; /* phys button to emit */
|
|
||||||
} emulateMB;
|
} emulateMB;
|
||||||
/* Third mouse button emulation */
|
/* Third mouse button emulation */
|
||||||
struct emulate3B {
|
struct emulate3B {
|
||||||
@@ -196,7 +204,7 @@ typedef struct {
|
|||||||
int button; /* phys button to emit */
|
int button; /* phys button to emit */
|
||||||
int threshold; /* move threshold in dev coords */
|
int threshold; /* move threshold in dev coords */
|
||||||
OsTimerPtr timer;
|
OsTimerPtr timer;
|
||||||
double delta[2]; /* delta x/y, accumulating */
|
int delta[2]; /* delta x/y, accumulating */
|
||||||
int startpos[2]; /* starting pos for abs devices */
|
int startpos[2]; /* starting pos for abs devices */
|
||||||
int flags; /* remember if we had rel or abs movement */
|
int flags; /* remember if we had rel or abs movement */
|
||||||
} emulate3B;
|
} emulate3B;
|
||||||
@@ -251,8 +259,10 @@ typedef struct {
|
|||||||
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
|
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
|
||||||
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
|
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
|
||||||
void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
|
void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
|
||||||
|
#ifdef MULTITOUCH
|
||||||
void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
|
void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
|
||||||
ValuatorMask *mask, uint16_t type);
|
ValuatorMask *mask, uint16_t type);
|
||||||
|
#endif
|
||||||
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
|
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
|
||||||
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
|
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
|
||||||
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo);
|
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo);
|
||||||
@@ -262,19 +272,19 @@ unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
|
|||||||
/* Middle Button emulation */
|
/* Middle Button emulation */
|
||||||
int EvdevMBEmuTimer(InputInfoPtr);
|
int EvdevMBEmuTimer(InputInfoPtr);
|
||||||
BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
|
BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
|
||||||
void EvdevMBEmuWakeupHandler(void *data, int i);
|
void EvdevMBEmuWakeupHandler(pointer, int, pointer);
|
||||||
void EvdevMBEmuBlockHandler(void *data, void *waitTime);
|
void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
|
||||||
void EvdevMBEmuPreInit(InputInfoPtr);
|
void EvdevMBEmuPreInit(InputInfoPtr);
|
||||||
void EvdevMBEmuOn(InputInfoPtr);
|
void EvdevMBEmuOn(InputInfoPtr);
|
||||||
void EvdevMBEmuFinalize(InputInfoPtr);
|
void EvdevMBEmuFinalize(InputInfoPtr);
|
||||||
|
|
||||||
/* Third button emulation */
|
/* Third button emulation */
|
||||||
CARD32 Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, void *arg);
|
CARD32 Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg);
|
||||||
BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL);
|
BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL);
|
||||||
void Evdev3BEmuPreInit(InputInfoPtr pInfo);
|
void Evdev3BEmuPreInit(InputInfoPtr pInfo);
|
||||||
void Evdev3BEmuOn(InputInfoPtr);
|
void Evdev3BEmuOn(InputInfoPtr);
|
||||||
void Evdev3BEmuFinalize(InputInfoPtr);
|
void Evdev3BEmuFinalize(InputInfoPtr);
|
||||||
void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy);
|
void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy);
|
||||||
void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
|
void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
|
||||||
|
|
||||||
/* Mouse Wheel emulation */
|
/* Mouse Wheel emulation */
|
||||||
|
|||||||
6
xorg-evdev.pc.in
Normal file
6
xorg-evdev.pc.in
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
sdkdir=@sdkdir@
|
||||||
|
|
||||||
|
Name: xorg-evdev
|
||||||
|
Description: X.Org evdev input driver.
|
||||||
|
Version: @PACKAGE_VERSION@
|
||||||
|
Cflags: -I${sdkdir}
|
||||||
Reference in New Issue
Block a user