Lines Matching defs:motion
594 struct motion_state *motion =
595 &((struct wsmouse_softc *) sc)->sc_input.motion;
597 motion->dx = dx;
598 motion->dy = dy;
599 motion->dz = dz;
600 motion->dw = dw;
602 motion->sync |= SYNC_DELTAS;
653 struct motion_state *motion =
654 &((struct wsmouse_softc *) sc)->sc_input.motion;
656 set_x(&motion->pos, x, &motion->sync, SYNC_X);
657 set_y(&motion->pos, y, &motion->sync, SYNC_Y);
754 value += input->motion.pos.x; /* fall through */
756 wsmouse_position(sc, value, input->motion.pos.y);
759 value += input->motion.pos.y; /* fall through */
761 wsmouse_position(sc, input->motion.pos.x, value);
795 /* Make touch and motion state consistent. */
799 struct motion_state *motion = &input->motion;
807 if (motion->sync & SYNC_POSITION) {
809 motion->pos.x -= motion->pos.dx;
810 motion->pos.y -= motion->pos.dy;
811 motion->sync &= ~SYNC_POSITION;
821 cleardeltas(&motion->pos);
859 * Pointer-control is assigned to slots with non-zero motion deltas if
921 /* Derive touch and motion state from MT state. */
935 if (mts->pos.x != input->motion.pos.x)
936 input->motion.sync |= SYNC_X;
937 if (mts->pos.y != input->motion.pos.y)
938 input->motion.sync |= SYNC_Y;
942 memcpy(&input->motion.pos, &mts->pos, sizeof(struct position));
1005 struct motion_state *motion = &input->motion;
1010 if (motion->sync & SYNC_DELTAS) {
1011 dx = h->inv ? -motion->dx : motion->dx;
1012 dy = v->inv ? -motion->dy : motion->dy;
1021 if (motion->dz) {
1023 ? -motion->dz : motion->dz;
1029 if (motion->dw) {
1031 ? -motion->dw : motion->dw;
1038 if (motion->sync & SYNC_POSITION) {
1039 if (motion->sync & SYNC_X) {
1040 x = (h->inv ? h->inv - motion->pos.x : motion->pos.x);
1043 if (motion->sync & SYNC_Y) {
1044 y = (v->inv ? v->inv - motion->pos.y : motion->pos.y);
1047 if (motion->pos.dx == 0 && motion->pos.dy == 0
1049 /* Suppress pointer motion. */
1071 struct motion_state *motion = &input->motion;
1078 if (motion->sync || mt_sync || t_sync || input->btn.sync)
1083 if (motion->sync & SYNC_POSITION)
1084 printf(" abs:%d,%d", motion->pos.x, motion->pos.y);
1085 if (motion->sync & SYNC_DELTAS)
1086 printf(" rel:%d,%d,%d,%d", motion->dx, motion->dy,
1087 motion->dz, motion->dw);
1122 input->motion.sync = 0;
1146 ^ input->motion.dx ^ input->motion.dy
1147 ^ input->motion.pos.x ^ input->motion.pos.y
1148 ^ input->motion.dz ^ input->motion.dw);
1165 input->motion.sync &= SYNC_POSITION;
1172 if (input->motion.sync)
1684 memset(&input->motion, 0, sizeof(struct motion_state));