mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-31 05:22:24 +01:00
36 lines
811 B
Diff
36 lines
811 B
Diff
diff --git a/InputEvent.hpp b/InputEvent.hpp
|
|
index 04ead03..16647b2 100644
|
|
--- a/InputEvent.hpp
|
|
+++ b/InputEvent.hpp
|
|
@@ -15,12 +15,16 @@
|
|
|
|
#include "CommonIncludes.hpp"
|
|
|
|
+#ifndef input_event_sec
|
|
+#define input_event_sec time.tv_sec
|
|
+#define input_event_usec time.tv_usec
|
|
+#endif
|
|
+
|
|
namespace evdevPlus {
|
|
class InputEvent {
|
|
public:
|
|
input_event event{};
|
|
|
|
- timeval &Time = event.time;
|
|
uint16_t &Type = event.type;
|
|
uint16_t &Code = event.code;
|
|
int32_t &Value = event.value;
|
|
@@ -36,8 +40,10 @@ namespace evdevPlus {
|
|
Code = code;
|
|
Value = value;
|
|
|
|
- if (time)
|
|
- memcpy(&event.time, time, sizeof(timeval));
|
|
+ if (time) {
|
|
+ event.input_event_sec = time->tv_sec;
|
|
+ event.input_event_usec = time->tv_usec;
|
|
+ }
|
|
}
|
|
|
|
friend void swap(InputEvent &first, InputEvent &second) {
|