mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-23 03:05:48 +03:00
testing/enjoy: new aport
https://github.com/cjacker/enjoy daemon to map joystick events to mouse/key events
This commit is contained in:
parent
46e0124e45
commit
a9c99cfad6
3 changed files with 96 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
From 9c35cf9caf031d6f67ec0211b8125d76f1983f58 Mon Sep 17 00:00:00 2001
|
||||
From: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
|
||||
Date: Wed, 23 Mar 2022 17:45:43 +0100
|
||||
Subject: [PATCH] fix setting timestamp of input event
|
||||
|
||||
On (some) 32 bit systems `struct input_event` has no member `time`.
|
||||
Instead, the macros `input_event_sec` and `input_event_usec` can be
|
||||
used in a portable fashion to access the timestamp.
|
||||
---
|
||||
uinput.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/uinput.c b/uinput.c
|
||||
index 41e2cac..fe3a3d5 100644
|
||||
--- a/uinput.c
|
||||
+++ b/uinput.c
|
||||
@@ -17,12 +17,19 @@
|
||||
extern int axis_y_direction;
|
||||
extern int motion_interval;
|
||||
|
||||
+static void _set_input_time(struct input_event *ie)
|
||||
+{
|
||||
+ struct timeval time;
|
||||
+ gettimeofday(&time, NULL);
|
||||
+ ie->input_event_sec = time.tv_sec;
|
||||
+ ie->input_event_usec = time.tv_usec;
|
||||
+}
|
||||
|
||||
void emit(int fd, int type, int code, int val)
|
||||
{
|
||||
struct input_event ie;
|
||||
memset(&ie, 0, sizeof(ie));
|
||||
- gettimeofday(&ie.time, NULL);
|
||||
+ _set_input_time(&ie);
|
||||
|
||||
ie.type = type;
|
||||
ie.code = code;
|
Loading…
Add table
Add a link
Reference in a new issue