repo.or.cz
/
rofl0r-libxauto.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
added a Makefile to use it as a C library. no python dependencies. added 2 example...
[rofl0r-libxauto.git]
/
src
/
test_sendtext.c
blob
dbf25f179f7af8a9890bded9347e057fcbc65b77
1
#include
"xaut.h"
2
#include <stdio.h>
3
4
int
main
(
int
argc
,
char
**
argv
) {
5
if
(
argc
<
3
)
return
1
;
6
7
char
*
id_text
;
8
char
*
send_text
;
9
if
(
strcmp
(
argv
[
1
],
"--v"
) ==
0
) {
10
if
(
argc
<
4
)
return
1
;
11
extra_verbose
(
1
);
12
id_text
=
argv
[
2
];
13
send_text
=
argv
[
3
];
14
}
else
{
15
id_text
=
argv
[
1
];
16
send_text
=
argv
[
2
];
17
}
18
19
Window winid
=
atoi
(
id_text
);
20
21
if
(
activate_window
(
winid
)) {
22
sleep
(
1
);
23
type
(
send_text
);
24
return
0
;
25
}
26
return
1
;
27
}