aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.h
Commit message (Collapse)AuthorAge
* Merge commit 'xf86-input-evdev-2.4.0' into code-remapcode-remap-2.4.0code-remapdakkar2010-07-24
|\
| * emuMB: default to disabled mouse button emulation for touchscreens.Oliver McFadden2010-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Because touchscreens only use one button (see EvdevProcessKeyEvent()) EvdevMBEmuFilterEvent() never calls EvdevMBEmuEnable(..., FALSE) to disable emulation. This results in touchscreen devices incurring a delay of Emulate3Timeout (typically 50 ms.) Default to MBEMU_DISABLED for touchscreen devices (unless overwritten by Xorg.conf.) Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
| * Fix a comment, EV_CNT is available since 2.6.24Peter Hutterer2009-12-01
| | | | | | | | | | | | Introduced in the kernel as 2.6.23-6147-g7b19ada. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* | aligned to Xorg coding styledakkar2010-04-25
| |
* | remap table and functions; TODO: init itdakkar2010-04-25
|/
* Add EvdevPostButtonEvent API to immediately post a button event (#23269)Peter Hutterer2009-08-14
| | | | | | | | | | | | | | | | The wheel emulation code needs this API. When the timer expires, the event must be posted immediately, not enqueued onto the internal event queue. Otherwise, the emulated middle button press is enqueued only and no event is sent until the next physical event (and its EV_SYN) arrives. Since the timer is triggered outside of the SIGIO and SIGIO is blocked during this period anyway, we could also just enqueue the event and flush by simulating an EV_SYN. It's easier this way though. X.Org Bug 23269 <http://bugs.freedesktop.org/show_bug.cgi?id=23269> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com>
* Rename parts of the Post API to a Queue API.Peter Hutterer2009-08-13
| | | | | | | | | | Button and key events aren't posted from EvdevPost*Event, they are simply enqueued onto the evdev-internal event queue until the next EV_SYN arrives. Rename those interfaces from EvdevPost* to EvdevQueue* and leave only those that actually post to the server with a matching "*Post*" name. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com>
* evdev: Use the EvdevPost...Event() functions in the emulation code.Oliver McFadden2009-08-04
| | | | | | | | | | | | | | | | | | This is similar to commit 1f641d75edba7394201c1c53938215bae696791b. It provides the same functionality of queuing the (in this case emulated) events and waiting until an EV_SYN synchronization event is received before posting them to the server. This preserves the order of events (both real and emulated) and ensures that MotionNotify events will always be posted first. It also unifies the event posting into a few small functions which improves maintainability. From this point on, you should never use the xf86Post...Event() functions in new code, but rather the EvdevPost...Event() versions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* evdev: Only send the events at synchronization time.Oliver McFadden2009-07-29
| | | | | | | | | | | | | | | | | | | Instead of just posting the button/key press/release events to the server as soon as they arrive, add them to an internal queue and post them once we receive an EV_SYN synchronization event. The motion events are always sent first, followed by the queued events. There will be one motion event and possibly many queued button/key events posted every EV_SYN event. Note that the size of the event queue (EVDEV_MAXQUEUE) is arbitrary and you may change it. If we receive more events than the queue can handle, those events are dropped and a warning message printed. Tested on my Lenovo T400 using evdev for all input devices; keyboard, touchpad, and trackpoint. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Rename pEvdev->buttons to pEvdev->num_buttons for clarity.Peter Hutterer2009-05-21
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Define MAX_VALUATORS if it's missing to allow for builds against 1.5.Peter Hutterer2009-03-09
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Revert "Remove useless include directive."Peter Hutterer2009-02-19
| | | | | | | | Necessary for builds against 1.6, but let's at least get rid of XKB defines. This reverts commit aa5dfa1d6ae374479d39f1394b85660e6b6bb881. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* General axis valuator support.Matt Helsley2009-02-16
| | | | | | | | | Instead of x/y and pressure, support any absolute axis that is reported on the device. Note that there are still locations that special-case X and Y. Minor modifications by Peter Hutterer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Change cached bitmasks from long to unsigned long.Peter Hutterer2009-02-16
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Remove unused 'screen' variable from the EvdevRec.Peter Hutterer2009-02-16
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Remove useless include directive.Peter Hutterer2009-02-16
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Deal with XINPUT ABI 5.Peter Hutterer2009-01-22
| | | | Some XKB stuff has been removed, so let's deal with it.
* Require XKB.Peter Hutterer2009-01-22
| | | | | | Welcome to the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix FOO_MAX off-by-oneMatt Helsley2009-01-12
| | | | | | | | | | | | | | | | | In linux/input.h each section's (e.g. ABS) FOO_MAX is the maximum FOO value. Recent kernels define FOO_CNT as the maximum number of FOO there will ever be. Hence using FOO_MAX to size the bit vectors representing the capabilities of an evdev device is off by one. Define FOO_CNT values for use with Linux kernels which lack them. Use FOO_CNT whenever we need to know the number of bits needed -- usually to calculate the number of longs needed. When iterating over the values FOO_MAX still seems appropriate however the loop test should include FOO_MAX rather than skip it. Signed-off-by: Matt Helsley <matt.helsley@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* rename NBITS to NLONGS to reflect its actual meaningMatt Helsley2009-01-12
| | | | | | | | | NBITS really convers the number of bits passed as its argument into a number of longs. This is somewhat atypical of many function-like-macro names. Rename it to NLONGS. Signed-off-by: Matt Helsley <matt.helsley@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add pressure valuatorMatt Helsley2009-01-12
| | | | | | | | If it's available report pressure as third valuator. (Use xf86PostMotionEventP instead of the varargs wrapper.) Signed-off-by: Matt Helsley <matt.helsley@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Revert "Keyboard: Disable kernel autorepeat"Sascha Hlusiak2008-12-08
| | | | | | | This reverts commit 6867652c2c8ad563d5655302d94134592b10265b. Functionally replaced by commit ece72ce9e97adae23b1932dc1334f63669196d56 Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Keyboard: Disable kernel autorepeatDaniel Stone2008-12-02
| | | | | | | We handle autorepeat in software due to per-key repeat and whatnot, so disable the kernel's, which just interferes with ours. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Store device file's minor/major to avoid duplicate devices.Peter Hutterer2008-11-17
| | | | | | | | Devices added that use the same min/maj as an already added device are ignored by the driver. This way users can have an xorg.conf entry on /dev/input/by-id/blahblah and not get the same device added by HAL. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
* Add support for axes swapping.Peter Hutterer2008-11-03
| | | | | | | | | New option: SwapAxes (boolean) New property: EVDEV_PROP_SWAP_AXES. Actual swapping code written by Donnie Berkholz. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
* Add support for run-time calibration.Peter Hutterer2008-10-30
| | | | | | | | | | Some devices require run-time axis calibration. We can't change the min/max ranges once we've initialised the valuator structs though, so in-driver run-time calibration is required. If the property is set, the driver scales from the calibrated range to the values reported to the X server (which then may scale to screen coordinates). If the property is not set (i.e. zero items) no scaling is performed.
* Treat BTN_[0-2] as LMR buttons if necessary.Peter Hutterer2008-10-29
| | | | | | | | | | | | | Treat BTN_[0-2] as LMR buttons on devices that do not advertise BTN_LEFT, BTN_MIDDLE, BTN_RIGHT (e.g. 3Dconnexion SpaceNavigator). Otherwise, treat BTN_[0+n] as button 5+n. Note: This causes duplicate mappings for BTN_0 + n and BTN_SIDE + n. This also fixes a bug where we could end up with negative button numbers after trying to map BTN_0. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
* emuMB: add EvdevMBEmuOn and call from EvdevOn to register wakeup handlers.Peter Hutterer2008-10-28
| | | | | | | This got broken in b0737bdbd1f6e601eb4984b6f4cb49279190984c, when the EmuMBPreInit call was removed from EvdevOn. As a result, VT switching away and back wouldn't restore the wakeup handlers and mouse button presses disappeared.
* Add option "GrabDevice", don't grab the device by default.Peter Hutterer2008-10-17
| | | | | | | | We now have the matching code in the server to set the console to RAW mode and don't need to grab the devices anymore. This is an updated version of e8534d47c8524ac081c2e3e6ebaabe4c6b274a18, which was reverted in 6dc41991557fa55a9e2f5aaf0fe40c70a08d41fd.
* Don't include the client-side header anymore. xkbstr.h is server SDK.Peter Hutterer2008-10-14
|
* Tidy up evdev.hPeter Hutterer2008-10-14
| | | | | This includes shuffling some functions around so we don't need the prototypes in evdev.h.
* Rename DragLockInit to DragLockPreInit, remove superfluous "return".Peter Hutterer2008-10-14
|
* Add checkonly handling to property handlers.Peter Hutterer2008-10-11
| | | | | If checkonly is TRUE, we can only check if applying the value would succeed. The value is actually applied if checkonly is FALSE.
* Add support for axis inversion.Søren Hauberg2008-10-03
|
* Use new property API (no ConfigureDP, less args to ChangeDP)Peter Hutterer2008-09-26
| | | | | Return appropriate status codes from property handlers. Make properties non-deletable.
* Attempt to re-open devices on read errors.Peter Hutterer2008-09-04
| | | | | | | | | | | | 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>
* Use HAVE_PROPERTIES define instead of GET_ABI_MAJOR for property compilation.Peter Hutterer2008-09-04
|
* Add timeout support for mouse wheel emulationDan Nicholson2008-08-22
| | | | | | | Support the EmulateWheelTimeout option as the mouse driver does. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
* Add property support for drag lock.Peter Hutterer2008-08-18
|
* Adding in DragLockButtons functionality.Chris Salch2008-08-18
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
* Revert "Don't grab devices unless specified through the config options."Peter Hutterer2008-08-15
| | | | | | | | | | Not such a good idea, CTRL+C terminates the server and other issues. Reverting for now until a better solution is found, at least this way the driver is usable. See also: http://lists.freedesktop.org/archives/xorg/2008-August/038032.html This reverts commit e8534d47c8524ac081c2e3e6ebaabe4c6b274a18.
* Don't grab devices unless specified through the config options.Peter Hutterer2008-08-14
| | | | | | | Grabbing event devices stops in-kernel event forwarding, most notably rfkill and the "Macintosh mouse button emulation" device. Let's not do that. Option "GrabDevice" forces grabbing the device.
* Simplify the property handler registration.Peter Hutterer2008-08-08
| | | | | Instead of having separate handlers for each property, just handle all of them in one handler for emuMB, and one handler for emuWheel.
* Add EVDEV_MAXBUTTONS instead of checking against 32.Peter Hutterer2008-08-08
| | | | Numbers are so lame, defines are all the rage now I've heard.
* Expose wheel emulation through device properties.Peter Hutterer2008-08-08
| | | | Don't enable wheel emulation with 0 inertia - bad things happen.
* Adding mouse wheel emulation code.Chris Salch2008-08-07
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Adding a function to map button events to button numbers.Chris Salch2008-08-06
| | | | | | | 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>
* Add support for ButtonMapping option.Peter Hutterer2008-07-22
|
* Add support for device properties, currently MB emulation and timeout.Peter Hutterer2008-07-10
|
* Count buttons at probe and print to log.Peter Hutterer2008-06-28
| | | | | | 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.