Changeset 1080
- Timestamp:
- Jun 1, 2008 11:42:03 PM (5 years ago)
- Location:
- trunk/xdotool
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xdotool/xdo.c
r1079 r1080 28 28 static int _xdo_has_xtest(xdo_t *xdo); 29 29 30 static KeyCode_xdo_keycode_from_char(xdo_t *xdo, char key);30 static int _xdo_keycode_from_char(xdo_t *xdo, char key); 31 31 static int _xdo_get_shiftcode_if_needed(xdo_t *xdo, char key); 32 32 … … 36 36 int *window_list_size); 37 37 38 static int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, uint **keys, uint *nkeys);38 static int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, int **keys, int *nkeys); 39 39 static int _xdo_keysequence_do(xdo_t *xdo, char *keyseq, int pressed); 40 40 static int _xdo_regex_match_window(xdo_t *xdo, Window window, int flags, regex_t *re); … … 124 124 int matched_window_list_size = 100; 125 125 126 int ret , i;126 int ret; 127 127 int i; 128 128 … … 181 181 XWindowChanges wc; 182 182 int ret; 183 uint cw_flags = 0;183 int cw_flags = 0; 184 184 185 185 wc.width = width; … … 418 418 } 419 419 420 int xdo_mousedown(xdo_t *xdo, uint button) {420 int xdo_mousedown(xdo_t *xdo, int button) { 421 421 int ret; 422 422 ret = XTestFakeButtonEvent(xdo->xdpy, button, True, CurrentTime); … … 425 425 } 426 426 427 int xdo_mouseup(xdo_t *xdo, uint button) {427 int xdo_mouseup(xdo_t *xdo, int button) { 428 428 int ret; 429 429 ret = XTestFakeButtonEvent(xdo->xdpy, button, False, CurrentTime); … … 432 432 } 433 433 434 int xdo_click(xdo_t *xdo, uint button) {434 int xdo_click(xdo_t *xdo, int button) { 435 435 int ret; 436 436 ret = xdo_mousedown(xdo, button); … … 447 447 int i = 0; 448 448 char key = '0'; 449 KeyCodekeycode = 0;450 uint shiftcode = 0;449 int keycode = 0; 450 int shiftcode = 0; 451 451 452 452 for (i = 0; string[i] != '\0'; i++) { … … 470 470 471 471 int _xdo_keysequence_do(xdo_t *xdo, char *keyseq, int pressed) { 472 uint *keys = NULL; 473 uint nkeys; 474 uint i; 472 int *keys = NULL; 473 int nkeys; 475 474 int i; 476 475 … … 481 480 482 481 for (i = 0; i < nkeys; i++) { 483 / * fprintf(stderr, "Typing %d (%d)\n", keys[i], pressed); */482 //fprintf(stderr, "Typing %d (%d)\n", keys[i], pressed); 484 483 XTestFakeKeyEvent(xdo->xdpy, keys[i], pressed, CurrentTime); 485 484 } … … 514 513 515 514 /* Helper functions */ 516 static KeyCode_xdo_keycode_from_char(xdo_t *xdo, char key) {515 static int _xdo_keycode_from_char(xdo_t *xdo, char key) { 517 516 int i = 0; 518 517 int len = xdo->keycode_high - xdo->keycode_low; … … 522 521 return xdo->charcodes[i].code; 523 522 524 return (KeyCode)-1;523 return -1; 525 524 } 526 525 … … 545 544 int keycodes_length = 0; 546 545 int shift_keycode = 0; 547 KeyCode i; 548 int j; 546 int i, j; 549 547 550 548 XDisplayKeycodes(xdo->xdpy, &(xdo->keycode_low), &(xdo->keycode_high)); … … 604 602 int *window_list_size) { 605 603 Window dummy; 606 <<<<<<< .working607 uint i;608 =======609 >>>>>>> .merge-right.r1078610 604 Window *children; 611 605 unsigned int i, nchildren; … … 637 631 } 638 632 639 int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, uint **keys, uint *nkeys) {633 int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, int **keys, int *nkeys) { 640 634 char *tokctx = NULL; 641 635 const char *tok = NULL; … … 644 638 645 639 /* Array of keys to press, in order given by keyseq */ 646 uint keys_size = 10;640 int keys_size = 10; 647 641 *nkeys = 0; 648 642 … … 655 649 strptr = strdup(keyseq); 656 650 while ((tok = strtok_r(strptr, "+", &tokctx)) != NULL) { 657 KeySymkeysym;651 int keysym; 658 652 if (strptr != NULL) 659 653 strptr = NULL; … … 788 782 } 789 783 790 <<<<<<< .working791 /* yay = strdup("ctrl+l"); */792 =======793 784 if (actual_format == 32) 794 785 nbytes = sizeof(long); … … 799 790 else if (actual_format == 0) 800 791 nbytes = 0; 801 >>>>>>> .merge-right.r1078 802 803 <<<<<<< .working 804 xdo = xdo_new(display_name); 805 /* xdo_mousemove(xdo, 100, 100); */ 806 /* usleep(100 * 1000); */ 807 /* xdo_keysequence(xdo, strdup("ctrl+l")); */ 808 /* xdo_type(xdo, strdup("ls")); */ 809 /* xdo_keysequence(xdo, strdup("Return")); */ 810 ======= 792 811 793 *nitems = _nitems; 812 794 *type = actual_type; … … 814 796 return prop; 815 797 } 816 >>>>>>> .merge-right.r1078817 798 818 799 int _xdo_ewmh_is_supported(xdo_t *xdo, const char *feature) { -
trunk/xdotool/xdo.h
r1079 r1080 27 27 typedef struct charcodemap { 28 28 char key; 29 KeyCodecode;29 int code; 30 30 int shift; 31 31 } charcodemap_t; … … 48 48 int xdo_mousemove(xdo_t *xdo, int x, int y); 49 49 int xdo_mousemove_relative(xdo_t *xdo, int x, int y); 50 int xdo_mousedown(xdo_t *xdo, uint button);51 int xdo_mouseup(xdo_t *xdo, uint button);50 int xdo_mousedown(xdo_t *xdo, int button); 51 int xdo_mouseup(xdo_t *xdo, int button); 52 52 53 int xdo_click(xdo_t *xdo, uint button);53 int xdo_click(xdo_t *xdo, int button); 54 54 55 55 int xdo_type(xdo_t *xdo, char *string); -
trunk/xdotool/xdotool.c
r1079 r1080 125 125 void cmd_help(int argc, char **args) { 126 126 int i; 127 128 /* touch to clean up warnings (we want the parameters to stick129 around because of the use of function pointers) */130 argc = 0;131 args = NULL;132 133 127 printf("Available commands:\n"); 134 128 for (i = 0; dispatch[i].name != NULL; i++) … … 173 167 174 168 void cmd_mousedown(int argc, char **args) { 175 uint button;169 int button; 176 170 char *cmd = *args; argc--; args++; 177 171 … … 190 184 191 185 void cmd_mouseup(int argc, char **args) { 192 uint button;186 int button; 193 187 char *cmd = *args; argc--; args++; 194 188 … … 237 231 return; 238 232 } 233 234 int (*func)(xdo_t *, char *) = NULL; 239 235 240 236 if (!strcmp(cmd, "key")) {
Note: See TracChangeset
for help on using the changeset viewer.

