project for a (works on my devices) demo
This commit is contained in:
45
events.h
Normal file
45
events.h
Normal 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);
|
||||
Reference in New Issue
Block a user