|
@@ -24,7 +24,7 @@ void controls_init(void) {
|
24
|
24
|
mouse.scroll_x = 0;
|
25
|
25
|
mouse.scroll_y = 0;
|
26
|
26
|
mouse.scroll_lock = false;
|
27
|
|
- mouse.fake_middle = false;
|
|
27
|
+ mouse.fake_middle = 0;
|
28
|
28
|
|
29
|
29
|
last_mouse = mouse;
|
30
|
30
|
}
|
|
@@ -111,9 +111,12 @@ struct mouse_state controls_mouse_read(void) {
|
111
|
111
|
mouse.internal_scroll_y = 0;
|
112
|
112
|
}
|
113
|
113
|
|
114
|
|
- if (mouse.fake_middle) {
|
115
|
|
- mouse.button[MOUSE_MIDDLE] = false;
|
116
|
|
- mouse.fake_middle = false;
|
|
114
|
+ if (mouse.fake_middle > 0) {
|
|
115
|
+ mouse.fake_middle++;
|
|
116
|
+ if (mouse.fake_middle > MOUSE_FAKE_MIDDLE_CLICK_TIME) {
|
|
117
|
+ mouse.fake_middle = 0;
|
|
118
|
+ mouse.button[MOUSE_MIDDLE] = false;
|
|
119
|
+ }
|
117
|
120
|
}
|
118
|
121
|
|
119
|
122
|
if (!mouse.scroll_lock && last_mouse.scroll_lock) {
|
|
@@ -121,7 +124,7 @@ struct mouse_state controls_mouse_read(void) {
|
121
|
124
|
if (scroll_sum < MIN_SCROLL_SUPPRESS_CLICK) {
|
122
|
125
|
// fake middle mouse click, user was not scrolling
|
123
|
126
|
mouse.button[MOUSE_MIDDLE] = true;
|
124
|
|
- mouse.fake_middle = true;
|
|
127
|
+ mouse.fake_middle = 1;
|
125
|
128
|
}
|
126
|
129
|
}
|
127
|
130
|
|