aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-14 21:29:32 +0000
committermarha <marha@users.sourceforge.net>2010-11-14 21:29:32 +0000
commit3425b16d521b8846b95df2b7d32a548d93341f3b (patch)
treefa430e95285d90f990b2d5574dad1e409ba5980c /xorg-server/dix/devices.c
parent41c64098a90b4e974d5005a1619472f2e8a64ea1 (diff)
downloadvcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.tar.gz
vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.tar.bz2
vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.zip
xserver pixman libX11 libXext 14/11/2010
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r--xorg-server/dix/devices.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index f10f7a08d..c1b04a8e6 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -261,8 +261,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
if (!dev)
return (DeviceIntPtr)NULL;
dev->id = devid;
- dev->public.processInputProc = (ProcessInputProc)NoopDDA;
- dev->public.realInputProc = (ProcessInputProc)NoopDDA;
+ dev->public.processInputProc = ProcessOtherEvent;
+ dev->public.realInputProc = ProcessOtherEvent;
dev->public.enqueueInputProc = EnqueueEvent;
dev->deviceProc = deviceProc;
dev->startup = autoStart;
@@ -272,6 +272,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
+ XkbSetExtension(dev, ProcessKeyboardEvent);
+
dev->coreEvents = TRUE;
/* sprite defaults */
@@ -1106,18 +1108,6 @@ NumMotionEvents(void)
return inputInfo.pointer->valuator->numMotionEvents;
}
-void
-RegisterPointerDevice(DeviceIntPtr device)
-{
- RegisterOtherDevice(device);
-}
-
-void
-RegisterKeyboardDevice(DeviceIntPtr device)
-{
- RegisterOtherDevice(device);
-}
-
int
dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
{
@@ -1261,16 +1251,19 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;
valc->numAxes = numAxes;
- valc->mode = mode;
valc->axes = (AxisInfoPtr)(valc + 1);
valc->axisVal = (double *)(valc->axes + numAxes);
+
+ if (mode & OutOfProximity)
+ InitProximityClassDeviceStruct(dev);
+
dev->valuator = valc;
AllocateMotionHistory(dev);
for (i=0; i<numAxes; i++) {
InitValuatorAxisStruct(dev, i, labels[i], NO_AXIS_LIMITS, NO_AXIS_LIMITS,
- 0, 0, 0);
+ 0, 0, 0, mode);
valc->axisVal[i]=0;
}
@@ -2367,8 +2360,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
event.valuators[i].min = master->valuator->axes[i].min_value;
event.valuators[i].max = master->valuator->axes[i].max_value;
event.valuators[i].resolution = master->valuator->axes[i].resolution;
- /* This should, eventually, be a per-axis mode */
- event.valuators[i].mode = master->valuator->mode;
+ event.valuators[i].mode = master->valuator->axes[i].mode;
event.valuators[i].name = master->valuator->axes[i].label;
}
}
@@ -2581,3 +2573,25 @@ AllocDevicePair (ClientPtr client, char* name,
return Success;
}
+/**
+ * Return Relative or Absolute for the device.
+ */
+int valuator_get_mode(DeviceIntPtr dev, int axis)
+{
+ return (dev->valuator->axes[axis].mode & DeviceMode);
+}
+
+/**
+ * Set the given mode for the axis. If axis is VALUATOR_MODE_ALL_AXES, then
+ * set the mode for all axes.
+ */
+void valuator_set_mode(DeviceIntPtr dev, int axis, int mode)
+{
+ if (axis != VALUATOR_MODE_ALL_AXES)
+ dev->valuator->axes[axis].mode = mode;
+ else {
+ int i;
+ for (i = 0; i < dev->valuator->numAxes; i++)
+ dev->valuator->axes[i].mode = mode;
+ }
+}