Changeset 1433ecda in mainline for uspace/srv/hid/isdv4_tablet/main.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/isdv4_tablet/main.c
r47b2d7e3 r1433ecda 94 94 fibril_mutex_unlock(&client_mutex); 95 95 96 if (!sess) return; 96 if (!sess) 97 return; 97 98 98 99 async_exch_t *exch = async_exchange_begin(sess); … … 105 106 } 106 107 async_msg_4(exch, MOUSEEV_ABS_MOVE_EVENT, event->x, event->y, 107 108 max_x, max_y); 108 109 if (event->type == PRESS || event->type == RELEASE) { 109 110 async_msg_2(exch, MOUSEEV_BUTTON_EVENT, event->button, 110 111 event->type == PRESS); 111 112 } 112 113 } … … 118 119 const char *type = NULL; 119 120 switch (event->type) { 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 121 case PRESS: 122 type = "PRESS"; 123 break; 124 case RELEASE: 125 type = "RELEASE"; 126 break; 127 case PROXIMITY_IN: 128 type = "PROXIMITY IN"; 129 break; 130 case PROXIMITY_OUT: 131 type = "PROXIMITY OUT"; 132 break; 133 case MOVE: 134 type = "MOVE"; 135 break; 136 default: 137 type = "UNKNOWN"; 138 break; 138 139 } 139 140 140 141 const char *source = NULL; 141 142 switch (event->source) { 142 143 144 145 146 147 148 149 150 143 case STYLUS_TIP: 144 source = "stylus tip"; 145 break; 146 case STYLUS_ERASER: 147 source = "stylus eraser"; 148 break; 149 case TOUCH: 150 source = "touch"; 151 break; 151 152 } 152 153 … … 160 161 { 161 162 switch (data_id) { 162 163 164 165 166 167 168 169 170 171 172 163 case 0: 164 return "resistive+stylus"; 165 case 1: 166 return "capacitive+stylus"; 167 case 2: 168 return "resistive"; 169 case 3: 170 case 4: 171 return "capacitive"; 172 case 5: 173 return "penabled"; 173 174 } 174 175 return "unknown"; … … 189 190 if (argc > arg && str_test_prefix(argv[arg], "--baud=")) { 190 191 size_t arg_offset = str_lsize(argv[arg], 7); 191 char *arg_str = argv[arg] + arg_offset;192 char *arg_str = argv[arg] + arg_offset; 192 193 if (str_length(arg_str) == 0) { 193 194 fprintf(stderr, "--baud requires an argument\n"); … … 219 220 } 220 221 arg++; 221 } 222 else { 222 } else { 223 223 category_id_t serial_cat_id; 224 224 … … 233 233 size_t svc_count; 234 234 235 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count); if (rc != EOK) { 235 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count); 236 if (rc != EOK) { 236 237 fprintf(stderr, "Failed getting list of services\n"); 237 238 return 1; … … 301 302 if (state.stylus_tilt_supported) { 302 303 printf("%ux%u\n", state.stylus_max_xtilt, state.stylus_max_ytilt); 303 } 304 else { 304 } else { 305 305 printf("not supported\n"); 306 306 } 307 307 printf(" Touch: %ux%u type: %s\n", state.touch_max_x, state.touch_max_y, 308 308 touch_type(state.touch_type)); 309 309 310 310 fid_t fibril = fibril_create(read_fibril, NULL); … … 337 337 if (rc != EOK) { 338 338 printf(NAME ": Unable to get mouse category id.\n"); 339 } 340 else { 339 } else { 341 340 rc = loc_service_add_to_cat(service_id, mouse_category); 342 341 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.