blob: 9d807b6e6269996dfabe2db68267333ea5f00a6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include "fakekey/fakekey.h"
int
main(int argc, char **argv)
{
Display *dpy;
FakeKey *fk;
int i;
unsigned char str[] = "hello HELLO worldly world", *p = NULL;
unsigned char str2[] = "\303\270";
if ((dpy = XOpenDisplay(NULL)) == NULL)
{
fprintf(stderr,"Failed to open display\n");
exit(1);
}
fk = fakekey_init(dpy);
p = str;
/*
for (i=0; i<10; i++)
{
fakekey_press(fk, str2, 2, 0);
fakekey_release(fk);
}
*/
while (*p != '\0')
{
fakekey_press(fk, p, 1, 0);
fakekey_release(fk);
p++;
}
}
|