|
@@ -76,17 +76,39 @@ struct mouse_state controls_mouse_read(void) {
|
76
|
76
|
mouse.delta_y = motion.delta_y;
|
77
|
77
|
}
|
78
|
78
|
|
|
79
|
+ mouse.scroll_x = 0;
|
|
80
|
+ mouse.scroll_y = 0;
|
|
81
|
+
|
79
|
82
|
if (mouse.scroll_lock) {
|
80
|
|
- mouse.scroll_x = mouse.delta_x;
|
81
|
|
- mouse.scroll_y = mouse.delta_y;
|
|
83
|
+ scroll_sum += abs(mouse.delta_x);
|
|
84
|
+ scroll_sum += abs(mouse.delta_y);
|
|
85
|
+
|
|
86
|
+ mouse.internal_scroll_x += mouse.delta_x;
|
|
87
|
+ mouse.internal_scroll_y += mouse.delta_y;
|
|
88
|
+
|
82
|
89
|
mouse.delta_x = 0;
|
83
|
90
|
mouse.delta_y = 0;
|
84
|
91
|
|
85
|
|
- scroll_sum += abs(mouse.scroll_x);
|
86
|
|
- scroll_sum += abs(mouse.scroll_y);
|
|
92
|
+ while (mouse.internal_scroll_x > SCROLL_REDUCE_SENSITIVITY) {
|
|
93
|
+ mouse.scroll_x += 1;
|
|
94
|
+ mouse.internal_scroll_x -= SCROLL_REDUCE_SENSITIVITY;
|
|
95
|
+ }
|
|
96
|
+ while (mouse.internal_scroll_x < -SCROLL_REDUCE_SENSITIVITY) {
|
|
97
|
+ mouse.scroll_x -= 1;
|
|
98
|
+ mouse.internal_scroll_x += SCROLL_REDUCE_SENSITIVITY;
|
|
99
|
+ }
|
|
100
|
+
|
|
101
|
+ while (mouse.internal_scroll_y > SCROLL_REDUCE_SENSITIVITY) {
|
|
102
|
+ mouse.scroll_y += 1;
|
|
103
|
+ mouse.internal_scroll_y -= SCROLL_REDUCE_SENSITIVITY;
|
|
104
|
+ }
|
|
105
|
+ while (mouse.internal_scroll_y < -SCROLL_REDUCE_SENSITIVITY) {
|
|
106
|
+ mouse.scroll_y -= 1;
|
|
107
|
+ mouse.internal_scroll_y += SCROLL_REDUCE_SENSITIVITY;
|
|
108
|
+ }
|
87
|
109
|
} else {
|
88
|
|
- mouse.scroll_x = 0;
|
89
|
|
- mouse.scroll_y = 0;
|
|
110
|
+ mouse.internal_scroll_x = 0;
|
|
111
|
+ mouse.internal_scroll_y = 0;
|
90
|
112
|
}
|
91
|
113
|
|
92
|
114
|
if (mouse.fake_middle) {
|