Commit Graph

193 Commits

Author SHA1 Message Date
Peter Hutterer
69f01976f1 evdev 2.0.5 xf86-input-evdev-2.0.5 2008-09-19 09:32:08 +09:30
Peter Hutterer
32768f8acd Attempt to re-open devices on read errors.
Coming back from resume may leave us with a file descriptor that can be opened
but fails on the first read (ENODEV).
In this case, try to open the device until it becomes available or until the
predefined count expires. To be safe, we cache the information from the device
and compare against it when we re-open. This way we ensure that if the
topology changes under us, we don't open a completely different device. If a
device has changed, we disable it.

Adds option "ReopenAttempts" <int>

Conflicts:

	man/evdev.man
	src/evdev.c
	src/evdev.h
2008-09-04 20:17:29 +09:30
Peter Hutterer
ed1382866c evdev 2.0.4 xf86-input-evdev-2.0.4 2008-08-14 23:17:16 +09:30
Adam Jackson
8fe38b2287 Print a warning if a keycode exceeds the range accepted by the server.
Keycodes over 255 are silently ignored in the server. The least we can do is
put a warning in the logs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c1f7f8c3d2)
2008-08-07 10:40:14 +09:30
Julien Cristau
ef607b6cce Actually close the fd on DEVICE_CLOSE (bug#16948)
Fixes file descriptor leak.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d9097df01b)
2008-08-04 09:25:27 +09:30
Julien Cristau
906a5d6add Print the device name when we get a read error
(cherry picked from commit 5c074af5a9)
2008-08-04 09:25:14 +09:30
Peter Hutterer
5152d616ca evdev 2.0.3 xf86-input-evdev-2.0.3 2008-08-01 17:29:24 +09:30
Michel Dänzer
2e9a71df5f xf86-input-evdev: Fix EVIOCGBIT ioctl usage on big endian platforms.
With this fix, on my PowerBook HAL hotplugging correctly detects my USB mouse,
and no longer thinks keyboards have random numbers of mouse buttons. :)

The LONG_BITS and NBITS macro definitions are stolen from xf86-input-synaptics.

Signed-off-by: Michel Dänzer <michel@tungstengraphics.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
[cherry-picked from master and fixed the trivial conflict -- jcristau]
2008-07-30 10:45:31 +02:00
Julien Cristau
49de32e70f Fill up the version info
Report correct versions instead of
"compiled for 0.0.0, module version = 1.0.0"
(cherry picked from commit 2b7edaa4ab)
2008-07-20 11:45:30 +02:00
Peter Hutterer
f135e07462 evdev 2.0.2 xf86-input-evdev-2.0.2 2008-07-14 13:34:36 +09:30
Peter Hutterer
e926356eb0 Don't enable the device if the grab failed with ENODEV.
After suspend/resume, sometimes the device doesn't come back up on the same
node. Since we do not call PreInit for the device (which would detect this
situation), we continue to try to read a nonexisting file, spamming the log
file with "Read Error".
(cherry picked from commit bf0d81011e)
2008-07-14 13:17:39 +09:30
Peter Hutterer
bd56ab3d72 Add .gitignore file.
(cherry picked from commit ef4bb69c1a)
2008-07-10 19:34:05 +09:30
Peter Hutterer
2b30413598 Remove static ChangeLog, autogenerate as part of make dist.
Hook taken from xserver's Makefile.am
(cherry picked from commit ec23c6b2f5)
2008-07-10 19:29:57 +09:30
Ander Conselvan de Oliveira
52fc8ee846 Mice with a lot of buttons (e.g. Logitech MX1000) generate button events greater than BTN_TASK.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
(cherry picked from commit 0830676a0c)
2008-07-10 19:29:45 +09:30
Peter Hutterer
b125b834f4 evdev 2.0.1 xf86-input-evdev-2.0.1 2008-06-22 17:52:58 +09:30
Peter Hutterer
05b20db8db No need to finalize MB emulation after EvdevProbe anymore.
Follow-up to 76800bfa75.
(cherry picked from commit 5a0ea39b79)
2008-06-22 16:26:10 +09:30
Simon Munton
43768d59da Close file descriptor if EvdevProbe fails.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
(cherry picked from commit 373e13ae35)
2008-06-22 16:25:48 +09:30
Keith Packard
9c524f6963 Enable middle button emulation at DEVICE_ON instead of DEVICE_INIT.
This ensures that the middle button emulation is re-enabled after VT switch,
otherwise the block handler that deals with the timeouts would not get
re-registered.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 76800bfa75)
2008-06-22 16:24:57 +09:30
Peter Hutterer
04003a98a9 evdev 2.0.0 xf86-input-evdev-2.0.0 2008-06-17 14:01:49 +09:30
Peter Hutterer
0443fb430f Shut up compiler warning "implicit declaration of function 'xf86Msg'" 2008-06-17 13:59:15 +09:30
Peter Hutterer
998f52010f Finalize MB emulation if EvdevProbe fails.
This avoids segfaults when HAL is restarted behind our backs. Also, only init
MB emulation when the device actually has a button.
2008-06-12 11:24:04 +09:30
Peter Hutterer
de07c04f5c evdev 1.99.4
1.99.3 had a nasty bug, so here's a quick update.
xf86-input-evdev-1.99.4
2008-06-11 11:55:12 +09:30
Peter Hutterer
01355b9d4b If Emulate3Buttons is specified in the config, don't auto-deactivate it.
Default setting is still "on" until middle button is pressed.  If the options
is however explicitly stated in the config file, it takes the value from the
config file, no matter if a middle button is present.
2008-06-11 11:23:53 +09:30
Peter Hutterer
9591dc1f6c Remove wakeup handlers when device is closed.
Less SIGABRTs are less exciting, but sometimes boredom is what we want.
2008-06-11 11:23:38 +09:30
Adam Jackson
08ba40b253 evdev 1.99.3 xf86-input-evdev-1.99.3 2008-06-10 17:35:33 -04:00
Peter Hutterer
39dc453691 Disable middle mouse button emulation when a real middle MB event is detected.
Devices may report middle mouse buttons even if they don't have one (PS/2
devices just don't know any better), so we can't be sure until we see the
event.
2008-06-10 22:48:01 +09:30
Peter Hutterer
e8887435ac Enable middle-mouse button emulation.
Ported from xf86-input-mouse, with a few cleanups.
2008-06-10 22:46:20 +09:30
Peter Hutterer
b0f6987ee6 Plug a memory leak, we allocated pEvdev twice, dropping the first memory area. 2008-06-10 22:43:37 +09:30
Sven Wegener
fec73e1418 evdev: Port b4a5a204 "Fix pointer crossing screen bug." to current master branch
The commit b4a5a204 fixed an issue, where we can't move the pointer to
other screens and this happens in current master branch again. This commit
ports the old commit to the current master branch.

Signed-off-by: Sven Wegener <swegener@gentoo.org>
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-08 21:44:57 +09:30
Peter Hutterer
da112737eb Check for XINPUT ABI < 3 (corrected version)
Thanks to Sven Wegener for pointing out the incorrect previous version.
2008-06-08 00:15:26 +09:30
Peter Hutterer
d40125ea8c Revert "Check for XINPUT ABI, parameters of InitValuatorClassRec have changed."
GetMotionEvents() doesn't exist, led to compile errors with servers pre-MPX
merge. Thanks to Sven Wegener for pointing this out.

This reverts commit 42422d8f69.
2008-06-08 00:13:35 +09:30
Peter Hutterer
42422d8f69 Check for XINPUT ABI, parameters of InitValuatorClassRec have changed. 2008-05-26 19:29:32 +09:30
Peter Hutterer
15e0091f0b Fail if the device cannot be grabbed during the probe.
If the grab fails, this is most likely a sign that the device has been grabbed
already (probably by a device specified in xorg.conf). So let's not add the
device to the server's input device list, since it won't generate events
anyway.

Exception: keyboards and kernel 2.4 are not affected.
2008-05-23 09:52:46 +09:30
Adam Jackson
d45f315845 evdev 1.99.2 xf86-input-evdev-1.99.2 2008-05-21 15:05:10 -04:00
Dan A. Dickey
a4a7003f7c Fix a trivial bug in testing for absolute axes.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-20 10:57:06 +09:30
Peter Hutterer
3e0dc9945d Shut up two compiler warnings. 2008-05-19 08:36:20 +09:30
Peter Hutterer
ff6251a2bd Remove unused EvdevOpts and EvdevOptions.
In the mouse driver, these options are only used if XFree86LOADER is
undefined. configure.ac in the xserver forces said define to 1 if we're
building the xfree86 DDX, so I don't see the point of having them around.
Especially since they weren't used in evdev anyway.
2008-05-19 08:24:55 +09:30
Peter Hutterer
e9222a8285 man: Option "Path" is supported in the code, add it to man page. 2008-05-18 11:04:43 +09:30
Peter Hutterer
8b7738457f Don't allow relative and absolute axes on the same device.
This is a bit of a mess. The MS Optical Desktop 2000 registers both relative
and absolute axes on the same device (the mouse). The absolute axes have a
valid min/max range for x/y and thus overwrite the x/y relative axes in the
server (no, this is not a server bug). And I wouldn't be surprised if other
devices have similar issues.

Since the device only sends relative events after that, the mouse is
essentially restricted to the min..max range of 0..255. The server simply
doesn't do unrestricted relative axis and restricted absolute axis on the same
device (not for the same axis numbers anyway).
2008-05-02 11:17:57 +09:30
Sascha Hlusiak
1b9deb8e7e Add XK_Meta_L and XK_Meta_R to list of modifiers
Stopps meta/super key from autorepeating
2008-04-01 17:24:13 +02:00
Daniel Stone
0ec391f51c Keyboard: Don't allow arbitrary keymap settings
Pretty much dead code anyway.
2008-03-28 17:46:38 +02:00
Adam Jackson
f77410e1f9 Map REL_DIAL to REL_HWHEEL.
Some Microsoft mice have this wrong.  And it seems like a sensible thing
to do anyway.
2008-03-14 11:15:01 -04:00
Adam Jackson
d28c2e1efb Filter out repeat events for mouse buttons.
Not many mice do this, but some do, Apple Mighty Mouse in particular, and
it makes click-and-drag pretty much impossible to use.

Arguably we should filter _all_ repeat events from the kernel and handle
synthesizing them in the server.
2008-03-12 13:54:10 -04:00
Adam Jackson
697e850a63 Fix middle/right button munging.
Don't do this in the button map.  That's writeable by clients, which means
they have the chance to get it wrong.  Just swap right and middle around
in event dispatch before you get to the user's map.
2008-03-11 19:07:58 -04:00
Adam Jackson
87037b9953 Force xkb_model to be "evdev".
Or at least, refuse to recognise the config option.  It's nonsensical to
use a model of something other than evdev, and it'll just break if you try.
2008-03-10 17:16:38 -04:00
Dan Nicholson
71f4eaec77 Fix cut-and-paste errors in xkb alternate spellings code
Fixes 2b334d6b69.
2008-03-09 22:52:13 +01:00
Adam Jackson
7208397612 Fix cut-and-paste error in abs-to-rel translation. 2008-03-09 16:15:14 -04:00
Adam Jackson
c250f84383 Fix the default XKB rules to be "base" instead of "xfree86". 2008-03-09 15:54:27 -04:00
Adam Jackson
2b334d6b69 Handle the alternate spellings of the xkb options. 2008-03-09 15:53:40 -04:00
Adam Jackson
9773dac623 Merge branch 'evdev-2.0-branch'
This resets to before the ad-hoc input hotplug state, ports that to
current server ABI, adds input hotplug integration, and re-adds support
for absolute coordinate events and XKB.  Several other small fixes were
cherry-picked from the new 1.2 branch.
2008-03-08 20:27:02 -05:00