1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
diff --git a/src/evdev.c b/src/evdev.c
index 7c6e921d..446a5cd6 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1160,6 +1161,7 @@ evdev_read_wheel_click_props(struct evdev_device *device)
&angles.x))
angles.x = angles.y;
}
+ angles.y=361;
return angles;
}
diff --git a/src/libinput.c b/src/libinput.c
index 01f53974..2ee9e1dc 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -33,6 +33,8 @@
#include <sys/epoll.h>
#include <unistd.h>
#include <assert.h>
+#include <fcntl.h>
+#include <sys/mman.h>
#include "libinput.h"
#include "libinput-private.h"
@@ -720,6 +722,15 @@ libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event,
return value;
}
+static char *multiplier="1";
+static void libinput_discrete_deltay_multiplier(void) {
+ int fd;
+ char *file = "/tmp/libinput_discrete_deltay_multiplier";
+ if ((fd = open(file, O_RDWR | O_CREAT, 0666)) == -1) return;
+ if (write(fd, "1", sizeof(char)) == -1) return;
+ multiplier = mmap(NULL, 1024, PROT_READ, MAP_SHARED, fd, 0);
+}
+
LIBINPUT_EXPORT double
libinput_event_pointer_get_axis_value_discrete(struct libinput_event_pointer *event,
enum libinput_pointer_axis axis)
@@ -740,7 +752,7 @@ libinput_event_pointer_get_axis_value_discrete(struct libinput_event_pointer *ev
value = event->discrete.x;
break;
case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
- value = event->discrete.y;
+ value = event->discrete.y * atoi(multiplier);
break;
}
}
@@ -1717,6 +1729,7 @@ libinput_init(struct libinput *libinput,
close(libinput->epoll_fd);
return -1;
}
+ libinput_discrete_deltay_multiplier();
return 0;
}
|