Commit 6e60db9b950e1e5379574a0d54b2a4ae64a5fbbb
- Diff rendering mode:
- inline
- side by side
src/wcmCommon.c
(58 / 0)
|   | |||
| 1191 | 1191 | } | |
| 1192 | 1192 | } | |
| 1193 | 1193 | ||
| 1194 | if (ds.device_type == TOUCH_ID) { | ||
| 1195 | WacomDeviceState* pds = &common->wcmTouchpadState; | ||
| 1196 | WacomDevicePtr priv = common->wcmDevices; | ||
| 1197 | |||
| 1198 | if (ds.proximity) | ||
| 1199 | switch (common->wcmTouchpadMode) { | ||
| 1200 | case 0: | ||
| 1201 | common->wcmTouchpadMode = 1; | ||
| 1202 | common->wcmTouchpadState = ds; | ||
| 1203 | common->wcmTouchpadState.sample = (int)GetTimeInMillis(); | ||
| 1204 | break; | ||
| 1205 | case 1: | ||
| 1206 | if (GetTimeInMillis() - pds->sample <= 200) { | ||
| 1207 | int xd = ds.x - pds->x; | ||
| 1208 | int yd = ds.y - pds->y; | ||
| 1209 | |||
| 1210 | if (xd*xd + yd*yd > 10*10) | ||
| 1211 | common->wcmTouchpadMode = 2; | ||
| 1212 | } else { | ||
| 1213 | /* left button down */ | ||
| 1214 | xf86PostButtonEvent(priv->local->dev, | ||
| 1215 | priv->flags & ABSOLUTE_FLAG, | ||
| 1216 | 1,1,0,priv->naxes, priv->oldX, | ||
| 1217 | priv->oldY,0,0,0,0); | ||
| 1218 | common->wcmTouchpadMode = 3; | ||
| 1219 | } | ||
| 1220 | break; | ||
| 1221 | } | ||
| 1222 | else { | ||
| 1223 | switch (common->wcmTouchpadMode) { | ||
| 1224 | case 1: | ||
| 1225 | if (GetTimeInMillis() - pds->sample <= 200) { | ||
| 1226 | /* left button down */ | ||
| 1227 | xf86PostButtonEvent(priv->local->dev, | ||
| 1228 | priv->flags & ABSOLUTE_FLAG, | ||
| 1229 | 1,1,0,priv->naxes, priv->oldX, | ||
| 1230 | priv->oldY,0,0,0,0); | ||
| 1231 | /* left button up */ | ||
| 1232 | xf86PostButtonEvent(priv->local->dev, | ||
| 1233 | priv->flags & ABSOLUTE_FLAG, | ||
| 1234 | 1,0,0,priv->naxes, priv->oldX, | ||
| 1235 | priv->oldY,0,0,0,0); | ||
| 1236 | } | ||
| 1237 | break; | ||
| 1238 | case 3: | ||
| 1239 | /* left button up */ | ||
| 1240 | xf86PostButtonEvent(priv->local->dev, | ||
| 1241 | priv->flags & ABSOLUTE_FLAG, | ||
| 1242 | 1,0,0,priv->naxes, priv->oldX, | ||
| 1243 | priv->oldY,0,0,0,0); | ||
| 1244 | } | ||
| 1245 | common->wcmTouchpadMode = 0; | ||
| 1246 | } | ||
| 1247 | if (common->wcmTouchpadMode == 1 || common->wcmTouchpadMode == 2) | ||
| 1248 | ds.buttons &= ~1; | ||
| 1249 | } | ||
| 1250 | |||
| 1251 | |||
| 1194 | 1252 | /* JEJ - Do not move this code without discussing it with me. | |
| 1195 | 1253 | * The device state is invariant of any filtering performed below. | |
| 1196 | 1254 | * Changing the device state after this point can and will cause |
src/wcmConfig.c
(1 / 0)
|   | |||
| 134 | 134 | common->wcmDevCls = &gWacomUSBDevice; /* device-specific functions */ | |
| 135 | 135 | common->wcmTPCButton = | |
| 136 | 136 | common->wcmTPCButtonDefault; /* set Tablet PC button on/off */ | |
| 137 | common->wcmTouchpadMode = 0; /* default to disable when touchpad isn't supported */ | ||
| 137 | 138 | common->wcmCapacity = -1; /* Capacity is disabled */ | |
| 138 | 139 | common->wcmCapacityDefault = -1; /* default to -1 when capacity isn't supported */ | |
| 139 | 140 | /* 3 when capacity is supported */ |
src/xf86WacomDefs.h
(2 / 0)
|   | |||
| 431 | 431 | int wcmGestureDefault; /* default touch gesture to disable when not supported */ | |
| 432 | 432 | int wcmGestureMode; /* data is in Gesture Mode? */ | |
| 433 | 433 | WacomDeviceState wcmGestureState[MAX_FINGERS]; /* inital state when in gesture mode */ | |
| 434 | int wcmTouchpadMode; /* state when in touchpad mode */ | ||
| 435 | WacomDeviceState wcmTouchpadState; /* inital state when entering touchpad mode */ | ||
| 434 | 436 | int wcmCapacity; /* disable/enable capacity */ | |
| 435 | 437 | int wcmCapacityDefault; /* default to -1 when capacity isn't supported/disabled */ | |
| 436 | 438 | /* 3 when capacity is supported */ |

