-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_emu.c
More file actions
41 lines (37 loc) · 737 Bytes
/
test_emu.c
File metadata and controls
41 lines (37 loc) · 737 Bytes
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
39
40
41
#include <stdio.h>
#include <unistd.h>
#include "src/libvinput.h"
int main(void)
{
EventEmulator emu;
VInputError err = EventEmulator_create(&emu);
if (err) {
printf("Error: %s\n", VInput_error_get_message(err));
return 1;
}
puts("5");
sleep(1);
puts("4");
sleep(1);
puts("3");
sleep(1);
puts("2");
sleep(1);
puts("1");
sleep(1);
err = EventEmulator_typec(&emu, 'H');
if (err) {
printf("Error: %s\n", VInput_error_get_message(err));
return 1;
}
err = EventEmulator_typec(&emu, 'i');
if (err) {
printf("Error: %s\n", VInput_error_get_message(err));
return 1;
}
err = EventEmulator_types(&emu, "\nHello world!", 13);
if (err) {
printf("Error: %s\n", VInput_error_get_message(err));
return 1;
}
}