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
42
43
44
45
46
47
48
49
50
|
--- a/pam/pam_thinkfinger-uinput.c
+++ b/pam/pam_thinkfinger-uinput.c
@@ -34,27 +34,40 @@
int uinput_cr (int *fd)
{
int retval = 0, ev_size = 0;
- struct input_event ev = {
+ struct input_event key_ev = {
.type = EV_KEY,
.code = KEY_ENTER,
.time = {0, }
};
- ev_size = sizeof (ev);
+ ev_size = sizeof (key_ev);
/* key press */
- ev.value = 1;
- if (write (*fd, &ev, ev_size) != ev_size) {
+ key_ev.value = 1;
+ if (write (*fd, &key_ev, ev_size) != ev_size) {
retval = errno;
goto out;
}
/* key release */
- ev.value = 0;
- if (write (*fd, &ev, ev_size) != ev_size) {
+ key_ev.value = 0;
+ if (write (*fd, &key_ev, ev_size) != ev_size) {
retval = errno;
goto out;
}
-
+
+ /* syn event */
+ struct input_event syn_ev = {
+ .time = {0, },
+ .type = EV_SYN,
+ .code = SYN_REPORT,
+ .value = 0
+ };
+
+ if (write (*fd, &syn_ev, ev_size) != ev_size) {
+ retval = errno;
+ goto out;
+ }
+
out:
return retval;
}
|