summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-12-27 17:06:53 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-12-27 17:06:53 +0100
commit60283fb1407fcd1de0586c960ed8d106f59483e9 (patch)
tree306d3daa5c409b0449b4151fa8939f88ddc84884 /include
parent4a9df9b604cec6ee4b4a6f01ef940443583f7573 (diff)
Got a clue about the pesky "SYN" messages.
I must not have read libevdev's documentation well enough. Hopefully this new approach will work better. The risk would be that the conversion takes too long and properly handling all events leads to an increasing lag between the physical and the virtual device. I should probably add an option to let users indicate they would prefer dropping missed events.
Diffstat (limited to 'include')
-rw-r--r--include/relabsd/device/physical_device.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/include/relabsd/device/physical_device.h b/include/relabsd/device/physical_device.h
index 17866f7..6b44802 100644
--- a/include/relabsd/device/physical_device.h
+++ b/include/relabsd/device/physical_device.h
@@ -2,10 +2,10 @@
#include <libevdev/libevdev.h>
-struct relabsd_input
+struct relabsd_physical_device
{
- struct libevdev * dev;
- int fd;
+ struct libevdev * libevdev;
+ int file;
int timed_out;
};
@@ -13,17 +13,20 @@ struct relabsd_input
* Returns -1 on (fatal) error,
* 0 on success.
*
- * 'input' does not need to be initialized, as the function will to that for
+ * 'device' does not need to be initialized, as the function will to that for
* you (on success).
* On success, 'input' will need to be closed.
*/
-int relabsd_input_open
+int relabsd_physical_device_open
(
- struct relabsd_input * const input,
- const struct relabsd_config * const conf
+ const char filename [const restrict static 1],
+ struct relabsd_physical_device device [const restrict static 1]
);
-void relabsd_input_close (const struct relabsd_input * const input);
+void relabsd_physical_device_close
+(
+ const struct relabsd_physical_device device [const restrict static 1]
+);
/*
* Returns -1 on (warning) error,
@@ -33,18 +36,15 @@ void relabsd_input_close (const struct relabsd_input * const input);
* do that for you (on success).
* Requires 'input' to be open.
*/
-int relabsd_input_read
+int relabsd_physical_device_read
(
- const struct relabsd_input * const input,
- unsigned int * const input_type,
- unsigned int * const input_code,
- int * const input_value
+ const struct relabsd_physical_device device [const restrict static 1],
+ unsigned int input_type [const restrict static 1],
+ unsigned int input_code [const restrict static 1],
+ int input_value [const restrict static 1]
);
-int relabsd_input_wait_for_next_event
+int relabsd_physical_device_is_late
(
- const struct relabsd_input * const input,
- const struct relabsd_config * const config
+ const struct relabsd_physical_device device [const restrict static 1]
);
-
-#endif