Commit Graph

198 Commits

Author SHA1 Message Date
Chris Salch
a9d72b40fb Adding mouse wheel emulation code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-07 16:04:31 +09:30
Adam Jackson
c1f7f8c3d2 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>
2008-08-07 09:36:02 +09:30
Chris Salch
40e1474d84 Adding a function to map button events to button numbers.
Remove code duplication, let the mapping function hand us the actual button
event to be passed up to the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-06 16:36:51 +09:30
Julien Cristau
d9097df01b Actually close the fd on DEVICE_CLOSE (bug#16948)
Fixes file descriptor leak.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-04 09:17:37 +09:30
Julien Cristau
5c074af5a9 Print the device name when we get a read error 2008-07-30 10:42:05 +02:00
Michel Dänzer
72551662a0 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>
2008-07-30 11:26:23 +09:30
Peter Hutterer
53e7525744 Add support for ButtonMapping option. 2008-07-22 11:49:33 +09:30
Peter Hutterer
5d13259a5d Guard property changes against ABI_XINPUT < 3. 2008-07-21 13:10:11 +09:30
Julien Cristau
2b7edaa4ab Fill up the version info
Report correct versions instead of
"compiled for 0.0.0, module version = 1.0.0"
2008-07-20 11:33:37 +02:00
Peter Hutterer
bf0d81011e 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".
2008-07-14 13:10:34 +09:30
Peter Hutterer
ef4bb69c1a Add .gitignore file. 2008-07-10 19:32:22 +09:30
Peter Hutterer
d1818ef206 Add support for device properties, currently MB emulation and timeout. 2008-07-10 17:08:49 +09:30
Peter Hutterer
a9223edcd8 Clean out configure.ac
We're not building with or without XInput. Same with xkb.
2008-07-10 16:55:21 +09:30
Peter Hutterer
ec23c6b2f5 Remove static ChangeLog, autogenerate as part of make dist.
Hook taken from xserver's Makefile.am
2008-07-03 15:01:32 +09:30
Peter Hutterer
18d70d796f Update COPYING with the correct copyright info.
Fix up licence of emuMB.c, was using Red Hat instead of "The authors", but
this code wasn't contributed by RH anyway.
2008-07-03 14:59:27 +09:30
Peter Hutterer
37b854cb64 Remove stale comments.
Ctrl+Alt+Backspace works, I'm using it daily.
CapsLock doesn't repeat, otherwise we wouldn't have Bug 16318.
2008-07-03 14:45:41 +09:30
Peter Hutterer
8c06093191 Remove EvdevConvert, nobody calls it now anyway.
Conversion is now done in the DIX.
2008-07-03 14:44:52 +09:30
Ander Conselvan de Oliveira
0830676a0c 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>
2008-06-28 17:54:33 +09:30
Peter Hutterer
1cf7b8f7ee Count buttons at probe and print to log.
We don't really do anything with the number other than print it since I'm sure
that half the mice don't report the correct number anyway (especially with the
wheel button mapping). But having a bit more debug info is good.
2008-06-28 17:53:24 +09:30
Peter Hutterer
826e6e7dd4 Bump to 2.0.99. 2008-06-22 17:52:40 +09:30
Peter Hutterer
5a0ea39b79 No need to finalize MB emulation after EvdevProbe anymore.
Follow-up to 76800bfa75.
2008-06-22 10:56:44 +09:30
Simon Munton
373e13ae35 Close file descriptor if EvdevProbe fails.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-22 10:56:00 +09:30
Keith Packard
76800bfa75 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>
2008-06-21 18:14:35 -07:00
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