project for a (works on my devices) demo

This commit is contained in:
beno
2026-03-13 16:38:39 +01:00
parent 3b13017f39
commit a70999a15c
17 changed files with 1113 additions and 61 deletions

45
events.h Normal file
View File

@@ -0,0 +1,45 @@
#pragma once
#include <sys/queue.h>
/*
emulating the structure from
/usr/aarch64-linux-gnu/include/linux/input.h
or
/usr/include/linux/input.h
*/
typedef struct {
unsigned short type;
unsigned short code;
unsigned int value;
} device_event;
typedef struct entry {
device_event *event;
SLIST_ENTRY(entry) entries; /* Singly linked List. */
} event_list_entry;
SLIST_HEAD(event_list_head, entry);
typedef struct {
struct event_list_head *headptr;
event_list_entry *events_last;
int count;
} events_queue;
void global_queue_init();
events_queue* events_queue_new();
void init_events_queue( events_queue *queue);
void add_to_events_queue( events_queue *queue, device_event* event);
void add_all_to_global_queue( events_queue *queue);
int drain_events_into( device_event** events);