Show event content for keyboard.
This commit is contained in:
parent
54201de47b
commit
ccc44b676c
|
@ -50,7 +50,8 @@ int dump_event(struct timespec* start, int fd, char* type) {
|
|||
return 1;
|
||||
}
|
||||
} else if(type == KEYBOARD) {
|
||||
if(event.type == EV_SYN) {
|
||||
// Ignore all but EV_KEY events on keyboard, they have no useful content.
|
||||
if(event.type != EV_KEY) {
|
||||
return 0;
|
||||
}
|
||||
if(event_content_keyboard(content_buffer, CONTENT_BUFFER_SIZE, &event)) {
|
||||
|
@ -71,7 +72,10 @@ int dump_event(struct timespec* start, int fd, char* type) {
|
|||
}
|
||||
|
||||
int event_content_keyboard(char* buffer, int buffer_size, struct input_event* event) {
|
||||
sprintf(buffer, "?");
|
||||
sprintf(buffer, "%d,%d,%d",
|
||||
event->type,
|
||||
event->code,
|
||||
event->value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue