diff options
Diffstat (limited to 'src/capabilities.c')
| -rw-r--r-- | src/capabilities.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/capabilities.c b/src/capabilities.c index a0655c8..7f8a8f7 100644 --- a/src/capabilities.c +++ b/src/capabilities.c | |||
| @@ -38,7 +38,7 @@ int read_capabilities(struct Capabilities *cap, int fd) | |||
| 38 | int rc; | 38 | int rc; |
| 39 | 39 | ||
| 40 | memset(cap, 0, sizeof(struct Capabilities)); | 40 | memset(cap, 0, sizeof(struct Capabilities)); |
| 41 | 41 | ||
| 42 | SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_SYN, sizeof(evbits)), evbits)); | 42 | SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_SYN, sizeof(evbits)), evbits)); |
| 43 | if (rc < 0) | 43 | if (rc < 0) |
| 44 | return rc; | 44 | return rc; |
| @@ -52,7 +52,6 @@ int read_capabilities(struct Capabilities *cap, int fd) | |||
| 52 | cap->has_left = getbit(keybits, BTN_LEFT); | 52 | cap->has_left = getbit(keybits, BTN_LEFT); |
| 53 | cap->has_middle = getbit(keybits, BTN_MIDDLE); | 53 | cap->has_middle = getbit(keybits, BTN_MIDDLE); |
| 54 | cap->has_right = getbit(keybits, BTN_RIGHT); | 54 | cap->has_right = getbit(keybits, BTN_RIGHT); |
| 55 | cap->has_mtdata = getbit(keybits, BTN_MT_REPORT_PACKET); | ||
| 56 | 55 | ||
| 57 | SETABS(cap, touch_major, absbits, ABS_MT_TOUCH_MAJOR, fd); | 56 | SETABS(cap, touch_major, absbits, ABS_MT_TOUCH_MAJOR, fd); |
| 58 | SETABS(cap, touch_minor, absbits, ABS_MT_TOUCH_MINOR, fd); | 57 | SETABS(cap, touch_minor, absbits, ABS_MT_TOUCH_MINOR, fd); |
| @@ -62,6 +61,8 @@ int read_capabilities(struct Capabilities *cap, int fd) | |||
| 62 | SETABS(cap, position_x, absbits, ABS_MT_POSITION_X, fd); | 61 | SETABS(cap, position_x, absbits, ABS_MT_POSITION_X, fd); |
| 63 | SETABS(cap, position_y, absbits, ABS_MT_POSITION_Y, fd); | 62 | SETABS(cap, position_y, absbits, ABS_MT_POSITION_Y, fd); |
| 64 | 63 | ||
| 64 | cap->has_mtdata = cap->has_position_x && cap->has_position_y; | ||
| 65 | |||
| 65 | return 0; | 66 | return 0; |
| 66 | } | 67 | } |
| 67 | 68 | ||
| @@ -90,19 +91,19 @@ void output_capabilities(const struct Capabilities *cap) | |||
| 90 | if (cap->has_width_major) | 91 | if (cap->has_width_major) |
| 91 | xf86Msg(X_INFO, "multitouch: width: %d %d\n", | 92 | xf86Msg(X_INFO, "multitouch: width: %d %d\n", |
| 92 | cap->abs_width_major.minimum, | 93 | cap->abs_width_major.minimum, |
| 93 | cap->abs_width_major.maximum); | 94 | cap->abs_width_major.maximum); |
| 94 | if (cap->has_orientation) | 95 | if (cap->has_orientation) |
| 95 | xf86Msg(X_INFO, "multitouch: orientation: %d %d\n", | 96 | xf86Msg(X_INFO, "multitouch: orientation: %d %d\n", |
| 96 | cap->abs_orientation.minimum, | 97 | cap->abs_orientation.minimum, |
| 97 | cap->abs_orientation.maximum); | 98 | cap->abs_orientation.maximum); |
| 98 | if (cap->has_position_x) | 99 | if (cap->has_position_x) |
| 99 | xf86Msg(X_INFO, "multitouch: position_x: %d %d\n", | 100 | xf86Msg(X_INFO, "multitouch: position_x: %d %d\n", |
| 100 | cap->abs_position_x.minimum, | 101 | cap->abs_position_x.minimum, |
| 101 | cap->abs_position_x.maximum); | 102 | cap->abs_position_x.maximum); |
| 102 | if (cap->has_position_y) | 103 | if (cap->has_position_y) |
| 103 | xf86Msg(X_INFO, "multitouch: position_y: %d %d\n", | 104 | xf86Msg(X_INFO, "multitouch: position_y: %d %d\n", |
| 104 | cap->abs_position_y.minimum, | 105 | cap->abs_position_y.minimum, |
| 105 | cap->abs_position_y.maximum); | 106 | cap->abs_position_y.maximum); |
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | //////////////////////////////////////////////////////// | 109 | //////////////////////////////////////////////////////// |
