Skip to content

Commit ed8d255

Browse files
committed
linux evdev: Stop using the time field of input_event
Fixes github issue #104. The time field is being removed from input_event (evdev) for 32bit systems, to prepare for the year 2038 32bit timestamp rollover. This breaks the build for spacenavd on 32bit linux systems. Turns out that value was only ever used by the incorrect dominant axis implementation which relied on timeouts (see github issue #84). Therefore the easy fix for the missing time field is to just drop it altogether and temporarilly disable the dominant axis code altogether until it's fixed.
1 parent 3985662 commit ed8d255

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

src/dev_usb_linux.c

-2
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ static int read_evdev(struct device *dev, struct dev_input *inp)
290290
}
291291

292292
if(rdbytes > 0) {
293-
inp->tm = iev.time;
294-
295293
switch(iev.type) {
296294
case EV_REL:
297295
inp->type = INP_MOTION;

src/event.c

+1-21
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ struct dev_event {
4848
struct dev_event *next;
4949
};
5050

51-
static struct dev_input inp_dom = { -1, {0}, -1, 0 };
52-
static int dom_axis_thres = 2;
53-
5451
static struct dev_event *add_dev_event(struct device *dev);
5552
static struct dev_event *device_event_in_use(struct device *dev);
5653
static void handle_button_action(int act, int val);
@@ -177,24 +174,7 @@ void process_input(struct device *dev, struct dev_input *inp)
177174
axis_sens = axis < 3 ? sens_trans : sens_rot;
178175

179176
if(dom_axis_mode) {
180-
if(inp_dom.idx != -1) {
181-
/* if more than 100ms have passed ... */
182-
if(inp->tm.tv_sec > inp_dom.tm.tv_sec || inp->tm.tv_usec - inp_dom.tm.tv_usec >= 100000) {
183-
inp_dom.idx = -1;
184-
memset(&inp_dom.tm, 0, sizeof inp_dom.tm);
185-
inp_dom.type = INP_FLUSH;
186-
inp_dom.val = 0;
187-
}
188-
}
189-
if((inp_dom.idx == -1 && (inp->val <= dom_axis_thres || inp->val >= dom_axis_thres))
190-
|| inp_dom.idx == axis) {
191-
inp_dom.idx = axis;
192-
inp_dom.tm = inp->tm;
193-
inp_dom.type = inp->type;
194-
inp_dom.val = inp->val;
195-
} else {
196-
axis_sens = 0;
197-
}
177+
/* TODO */
198178
}
199179
inp->val = (int)((float)inp->val * cfg.sensitivity * axis_sens);
200180

src/event.h

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ enum {
8888

8989
struct dev_input {
9090
int type;
91-
struct timeval tm;
9291
int idx;
9392
int val;
9493
};

0 commit comments

Comments
 (0)