Show event content for keyboard.

This commit is contained in:
Eli Ribble 2021-08-27 10:33:08 -06:00
parent 54201de47b
commit ccc44b676c
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}