summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Xinput.c
AgeCommit message (Collapse)AuthorFilesLines
2011-05-25xfree86: Allow "MatchLayout" statements in config filesOleh Nykyforchyn1-0/+21
Usage example (tested on a dual-seat PC): Section "InputClass" Identifier "keyboard-all" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" MatchLayout "!GeForce|!Matrox" Driver "evdev" Option "XkbLayout" "us" Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection It disables auto keyboard configuration for layouts "GeForce" and "Matrox". Note that "" in patterns means "no Layout sections found", e.g. MatchLayout "GeForce|" is "in layout GeForce or without explicit layout at all". Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-11input: remove DDX event list handlingPeter Hutterer1-7/+4
The current approach to event posting required the DDX to request the event list (allocated by the DIX) and then pass that list into QueuePointerEvent and friends. Remove this step and use the DIX event list directly. This means that QueuePointerEvent is not reentrant but it wasn't before anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11input: replace EventListPtr with InternalEvent arrayPeter Hutterer1-1/+1
EventListPtr is a relic from pre-1.6, when we had protocol events in the event queue and thus events of varying size. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11input: Provide Queue{Button|Keyboard|Proximity}Event helpersPeter Hutterer1-29/+9
Don't require every caller to use GPE + mieqEnqueue, provide matching Queue...Event functions instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11xfree86: print the device ID to the log when adding a device.Peter Hutterer1-2/+2
Sometimes the name isn't enough, it's handy to see the device ID's from the log file. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-21xfree86: removed unused "event" variable in xf86PostMotionEventMPeter Hutterer1-2/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-18input: remove GetKeyboardValuatorEvents, this is now unnecessary.Peter Hutterer1-10/+3
GetKeyboardValuatorEvents handles NULL valuator masks already, so the GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-03-24xf86: don't pretend to support DEVICE_ABS_* in ChangeDeviceControlSimon Thum1-2/+2
Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-24xfree86: print out which driver is about to be used.Peter Hutterer1-0/+2
Makes reading the log file a lot easier for those that don't magically recognise the log spew by the individual drivers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-03-09xfree86: block signals between EnableDevice and first CheckMotion()Peter Hutterer1-0/+3
Devices usually enable SIGIO processing in EnableDevice. CheckMotion initialises the pointer sprite, sends Enter/Leave events, etc. This leaves us with a small window where events may be processed without the sprite or pointer position (as seen from the protocol) is valid. Block signals during this window. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-01-27xfree86/dga: Remove useless ifdefsVille Syrjala1-13/+7
Move some variables to the scope where they are used. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-01-27xfree86/input: Restore DGAStealKeyEvent()Ville Syrjala1-0/+13
DGA key event support was lost in commit 8da0ff2d51086666d10ca7330d428e8610a4a0e3. Bring it back. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-14xfree86: always report the input options before initialising the device.Peter Hutterer1-0/+1
After collecting the driver's default options, report the list of options set for the device before calling PreInit(). This helps with debugging those cases where options are not merged correctly. xf86OptionListReport reports with verbosity 5, higher than the default verbosity so this won't generate logspam in the default case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2010-12-09xfree86: don't set movement flags for non-valuator events.Peter Hutterer1-8/+14
If a device doesn't send valuators, don't try to move its position. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-12-07xfree86: use xf86AllocateInput() for xorg.conf devices too.Peter Hutterer1-1/+1
Single allocation point for input devices, most notably a single point to reset default values. Without this patch, the file descriptor default was -1 for hotplugged devices and 0 for config devices. Drivers that don't overwrite the default themselves would thus fail if configured in the xorg.conf. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-12-07xfree86: add option "Floating", deprecate SendCoreEvents and friends.Peter Hutterer1-1/+2
Some devices should be initialised as floating from the start (e.g. Joysticks and accelerometers benefit from this). Currently users use the "SendCoreEvents" "off" flag for this, which isn't the most appropriate naming. Add an option "Floating", deprecate the others. Still parsed and handled by the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-11-24xfree86: add missing linebreak in error message.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Magnus Kessler <Magnus.Kessler@gmx.net>
2010-11-11Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Peter Hutterer1-16/+19
input-api Conflicts: dix/getevents.c hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-22Add support for per-axis valuator modes (Relative/Absolute)Chase Douglas1-2/+2
The XI2 protocol supports per-axis modes, but the server so far does not. This change adds support in the server. A complication is the fact that XI1 does not support per-axis modes. The solution provided here is to set a per-device mode that defines the mode of at least the first two valuators (X and Y). Note that initializing the first two axes to a different mode than the device mode will fail. For XI1 events, any axes following the first two that have the same mode will be sent to clients, up to the first axis that has a different mode. Thus, if a device has relative, then absolute, then relative mode axes, only the first block of relative axes will be sent over XI1. Since the XI2 protocol supports per-axis modes, all axes are sent to the client. Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22xfree86: convert xf86Post{Motion|Key|Button|Proximity}Event to masksPeter Hutterer1-18/+18
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22Abstract valuator masks through a set of APIs.Peter Hutterer1-22/+69
This commit introduces an abstraction API for handling masked valuators. The intent is that drivers just allocate a mask, set the data and pass the mask to the server. The actual storage type of the mask is hidden from the drivers. The new calls for drivers are: valuator_mask_new() /* to allocate a valuator mask */ valuator_mask_zero() /* to reset a mask to zero */ valuator_mask_set() /* to set a valuator value */ The new interface to the server is xf86PostMotionEventM() xf86PostButtonEventM() xf86PostKeyboardEventM() xf86PostProximityEventM() all taking a mask instead of the valuator array. The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to memory allocation restrictions in SIGIO handlers. For easier review, a lot of the code still uses separate valuator arrays. This will be fixed in a later patch. This patch was initially written by Chase Douglas. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-15Merge branch 'master' into input-apiPeter Hutterer1-4/+1
Conflicts: config/udev.c hw/xfree86/common/xf86Helper.c hw/xfree86/common/xf86Module.h hw/xfree86/common/xf86Xinput.h hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-15xfree86: rename parameter names to xf86ScaleAxis.Peter Hutterer1-16/+19
Maybe it's just me but every time I look at it I get confused again and need to work it out from scratch. Rename the parameters to something self-explanatory, to/from and min/max. No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-09-10xfree86: move XI_VERIFY_VALUATORS to the source file it's used in.Peter Hutterer1-0/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10xfree86: update comment for xf86DeleteInputPeter Hutterer1-3/+1
We have a driver hook - it's UnInit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10xfree86: remove IDevRec, replace with InputInfoRec.Peter Hutterer1-78/+63
This struct is superfluous, maintaining the same info as the InputInfoRec (with the exception of the driver name). This is a rather large commit with the majority of changes being a rename from the fields of the IDevRec (idev, commonOptions) to the InputInfoRec (pInfo, options). The actual changes affect the initialization process of the input device: In NewInputDeviceRequest, the InputInfoRec is now always allocated and just added to the internal list in xf86NewInputDevice() if the init process succeeded. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10xfree86: plug minor memory leak.Peter Hutterer1-1/+2
When no identifier for the device was specified, the allocated IDevRec (and its associated fields) need to be freed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10xfree86: Remove extraOptions parameter from xf86CollectInputOptions.Peter Hutterer1-1/+1
And unexport it, drivers don't need to call this in the new init process. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10xfree86: remove some ifdef 0 code.Peter Hutterer1-6/+0
InputInfoRec hasn't had a free function pointer since the git import. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10xfree86: move a declaration down to the block it is used in.Peter Hutterer1-3/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10xfree86: minor comment fix. HAL → config backendPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 xfree86: skip a few NULL initialization, calloc does it for us.Peter Hutterer1-6/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10xfree86: remove conversion procs and close proc from InputInfoRec.Peter Hutterer1-3/+0
None of them are called by the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-06Remove atom field from InputInfoRec.Peter Hutterer1-2/+3
This field was only used in one location where we can use a local variable. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-06input: constify valuators passed in by input drivers.Peter Hutterer1-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-01xfree86: remove history_sizePeter Hutterer1-4/+0
For a couple of ABIs now the history size was essentially static anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01xfree86: remove always_core_feedback from InputInfoRec.Peter Hutterer1-1/+0
Unused Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01xfree86: remove private_flags from InputInfoRec.Peter Hutterer1-1/+0
Unused field. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01input: Purge AddOtherInputDevices DDX hook.Peter Hutterer1-5/+0
This hook wasn't used by any DDX. Device addition and removal is handled by the config backend, so we don't need to do anything special that during the ListInputDevices request processing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: remove OpenInputDevice and CloseInputDevice DDX hooks.Peter Hutterer1-41/+0
In theory, these hooks were to be used for DDX-specific device enablement. None of the DDXs however did anything here. Now we call DEVICE_INIT on all devices when they are added, so the xfree86 DDX as the only one with real code didn't do anything here. kdrive checked for device validity but that's already handled in ProcXOpenDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: Fix xf86 backend-specific input initializationSimon Thum1-3/+24
Instead of shoving it in rather unrelated places, move acceleration init into xf86NewInputDevice. Caveat: It's not clear atm how relevant other callers of ActivateDevice (like OpenDevice) actually are. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: purge superfluous includes from xf86Xinput.cPeter Hutterer1-16/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: remove LocalDeviceRec/Ptr definition.Peter Hutterer1-41/+41
Two names pointing to the same struct for over 7 years now. Remove the define, if drivers don't want to change they can always do the typedef themselves. Rename all "LocalDevicePtr local" to "InputInfoPtr pInfo". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: move xf86AllocateInput and xf86DeleteInput to xf86Xinput.cPeter Hutterer1-0/+89
Make xf86AllocateInput static in the process, this function is only called from one location. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: return the device from xf86ActivateDevice.Peter Hutterer1-5/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: set XKB extension for all new devices, not just xfree86 ones.Peter Hutterer1-2/+0
Right now, Xephyr and others don't get to use XKB on the slave devices. Which works given that no-one cares about SDs just yet but event processing is different if the ProcessInputProc isn't wrapped properly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: purge SendDragEvents support.Peter Hutterer1-24/+1
From the documentation: "This is mainly to allow a touch screen to be used with netscape and other browsers which do strange things if the mouse moves between button down and button up." CLOSED - NOTOURBUG Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: remove XI86_CONFIGURED flag.Peter Hutterer1-31/+21
PreInit returns a status code. Let's use that instead of having it report Success in some cases but not set the XI86_CONFIGURED flag and thus signal an init failure. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: Purge Register*Device() functions.Peter Hutterer1-1/+0
RegisterPointerDevice() and RegisterKeyboardDevice() were already mapped to RegisterOtherDevice() and obsolete. RegisterOtherDevice() was called for all devices and the two assignments can simply be moved into AddInputDevice(). Purge RegisterOtherDevice() and pretend it never happened. *lalalalala* Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: remove superflous assignments.Peter Hutterer1-2/+0
ActivateGrab and DeactivateGrab are set in AddInputDevice() already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>