summaryrefslogtreecommitdiff
path: root/driver/xf86-input-synaptics/src
diff options
context:
space:
mode:
authorAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-05-07 17:30:32 +0000
committerAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-05-07 17:30:32 +0000
commit1e607a648d5f15f8ad3d4121769c71d2e417b35e (patch)
treef62f8b98b0452d1ce679f3e178f729c87b74d5c3 /driver/xf86-input-synaptics/src
parent95d258d9c7697b206df906f645600bfaa885eeb8 (diff)
Add support new ioctl WSMOUSEIO_SETMODE.
ok matthieu@
Diffstat (limited to 'driver/xf86-input-synaptics/src')
-rw-r--r--driver/xf86-input-synaptics/src/wsconscomm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/driver/xf86-input-synaptics/src/wsconscomm.c b/driver/xf86-input-synaptics/src/wsconscomm.c
index 6b188cea6..a439dacc8 100644
--- a/driver/xf86-input-synaptics/src/wsconscomm.c
+++ b/driver/xf86-input-synaptics/src/wsconscomm.c
@@ -69,6 +69,24 @@ out:
return res;
}
+static void
+WSConsDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters *para)
+{
+ int wsmouse_mode = WSMOUSE_NATIVE;
+
+ if (ioctl(pInfo->fd, WSMOUSEIO_SETMODE, &wsmouse_mode) == -1)
+ xf86Msg(X_ERROR, "%s: cannot set absolute mode\n", pInfo->name);
+}
+
+static void
+WSConsDeviceOffHook(InputInfoPtr pInfo)
+{
+ int wsmouse_mode = WSMOUSE_COMPAT;
+
+ if (ioctl(pInfo->fd, WSMOUSEIO_SETMODE, &wsmouse_mode) == -1)
+ xf86Msg(X_ERROR, "%s: cannot set relative mode\n", pInfo->name);
+}
+
static Bool
WSConsQueryHardware(InputInfoPtr pInfo)
{
@@ -238,8 +256,8 @@ WSConsReadDevDimensions(InputInfoPtr pInfo)
}
struct SynapticsProtocolOperations wscons_proto_operations = {
- NULL,
- NULL,
+ WSConsDeviceOnHook,
+ WSConsDeviceOffHook,
WSConsQueryHardware,
WSConsReadHwState,
WSConsAutoDevProbe,