Lines 30-39
Link Here
|
30 |
#include <string.h> |
30 |
#include <string.h> |
31 |
#include <sys/types.h> |
31 |
#include <sys/types.h> |
32 |
#include <sys/stat.h> |
32 |
#include <sys/stat.h> |
|
|
33 |
#include <sys/time.h> |
33 |
#include <fcntl.h> |
34 |
#include <fcntl.h> |
34 |
#include <libdaemon/daemon.h> |
35 |
#include <libdaemon/daemon.h> |
35 |
#include <config.h> |
36 |
#include <config.h> |
36 |
#include <fcntl.h> |
|
|
37 |
#include <unistd.h> |
37 |
#include <unistd.h> |
38 |
|
38 |
|
39 |
#ifdef HAVE_CONFIG_H |
39 |
#ifdef HAVE_CONFIG_H |
Lines 101-111
Link Here
|
101 |
struct input_event event; |
101 |
struct input_event event; |
102 |
memset(&event, 0, sizeof(event)); |
102 |
memset(&event, 0, sizeof(event)); |
103 |
|
103 |
|
|
|
104 |
gettimeofday(&event.time, NULL); |
104 |
event.type = EV_KEY; |
105 |
event.type = EV_KEY; |
105 |
event.code = code; |
106 |
event.code = code; |
106 |
event.value = G15KEY_DOWN; |
107 |
event.value = G15KEY_DOWN; |
107 |
|
108 |
|
108 |
write (uinp_fd, &event, sizeof(event)); |
109 |
write (uinp_fd, &event, sizeof(event)); |
|
|
110 |
|
111 |
event.type = EV_SYN; |
112 |
event.code = SYN_REPORT; |
113 |
event.value = 0; |
114 |
|
115 |
write(uinp_fd, &event, sizeof(event)); |
116 |
|
117 |
daemon_log(LOG_DEBUG,"UINPUT device: G key pressed."); |
109 |
} |
118 |
} |
110 |
|
119 |
|
111 |
void g15_uinput_keyup(unsigned char code) |
120 |
void g15_uinput_keyup(unsigned char code) |
Lines 113-123
Link Here
|
113 |
struct input_event event; |
122 |
struct input_event event; |
114 |
memset(&event, 0, sizeof(event)); |
123 |
memset(&event, 0, sizeof(event)); |
115 |
|
124 |
|
|
|
125 |
gettimeofday(&event.time, NULL); |
116 |
event.type = EV_KEY; |
126 |
event.type = EV_KEY; |
117 |
event.code = code; |
127 |
event.code = code; |
118 |
event.value = G15KEY_UP; |
128 |
event.value = G15KEY_UP; |
119 |
|
129 |
|
120 |
write (uinp_fd, &event, sizeof(event)); |
130 |
write (uinp_fd, &event, sizeof(event)); |
|
|
131 |
|
132 |
event.type = EV_SYN; |
133 |
event.code = SYN_REPORT; |
134 |
event.value = 0; |
135 |
|
136 |
write(uinp_fd, &event, sizeof(event)); |
137 |
|
138 |
daemon_log(LOG_DEBUG,"UINPUT device: G key released."); |
121 |
} |
139 |
} |
122 |
|
140 |
|
123 |
#endif |
141 |
#endif |