Formatted.
This commit is contained in:
parent
f17d732df6
commit
634c8a1727
22
tikker.c
22
tikker.c
@ -1,16 +1,15 @@
|
|||||||
|
#include "sormc.h"
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <linux/input.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <linux/input.h>
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include "sormc.h"
|
#include <unistd.h>
|
||||||
|
|
||||||
#define MAX_DEVICES 32
|
#define MAX_DEVICES 32
|
||||||
#define DEVICE_PATH "/dev/input/event"
|
#define DEVICE_PATH "/dev/input/event"
|
||||||
|
|
||||||
|
|
||||||
int is_keyboard(int fd) {
|
int is_keyboard(int fd) {
|
||||||
char device_name[256] = {0};
|
char device_name[256] = {0};
|
||||||
|
|
||||||
@ -99,16 +98,11 @@ int main() {
|
|||||||
times_repeated++;
|
times_repeated++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sormq(db, "INSERT INTO kevent (code, event, name,timestamp) VALUES (%d, %s, %s, DATETIME('now'))",ev.code,event_name,key_name);
|
sormq(db, "INSERT INTO kevent (code, event, name,timestamp) VALUES (%d, %s, %s, DATETIME('now'))", ev.code,
|
||||||
printf("Event: %s, ",
|
event_name, key_name);
|
||||||
ev.value == 1 ? "PRESSED" :
|
printf("Event: %s, ", ev.value == 1 ? "PRESSED" : ev.value == 0 ? "RELEASED" : "REPEATED");
|
||||||
ev.value == 0 ? "RELEASED" : "REPEATED");
|
|
||||||
printf("Key Code: %d ", ev.code);
|
printf("Key Code: %d ", ev.code);
|
||||||
printf("Pr: %lld Rel: %lld Rep: %lld\n",
|
printf("Pr: %lld Rel: %lld Rep: %lld\n", times_pressed, times_released, times_repeated);
|
||||||
times_pressed,
|
|
||||||
times_released,
|
|
||||||
times_repeated
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user