| 318 | } |
| 319 | |
| 320 | static void ProcessMouse(char* buf, int n) { |
| 321 | char cpy[256 + 2]; |
| 322 | strncpy(cpy, buf, n); |
| 323 | char* tok = strtok(cpy + 3, ";"); |
| 324 | int mouse; |
| 325 | if (!tok) return; |
| 326 | |
| 327 | switch (tok[0]) { |
| 328 | case '0': |
| 329 | mouse = strchr(buf, 'm') == NULL; |
| 330 | UpdatePointerPosition(tok); |
| 331 | Input_SetNonRepeatable(CCMOUSE_L, mouse); |
| 332 | break; |
| 333 | case '1': |
| 334 | mouse = strchr(buf, 'm') == NULL; |
| 335 | UpdatePointerPosition(tok); |
| 336 | Input_SetNonRepeatable(CCMOUSE_M, mouse); |
| 337 | break; |
| 338 | case '2': |
| 339 | mouse = strchr(buf, 'm') == NULL; |
| 340 | UpdatePointerPosition(tok); |
| 341 | Input_SetNonRepeatable(CCMOUSE_R, mouse); |
| 342 | break; |
| 343 | case '3': |
| 344 | mouse = (strcmp(tok, "32") == 0); |
| 345 | UpdatePointerPosition(tok); |
| 346 | break; |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | static int MapKey(int key) { |
| 351 | if (key == ' ') return CCKEY_SPACE; |
no test coverage detected