Page MenuHomeFreeBSD

D59607.id186501.diff
No OneTemporary

D59607.id186501.diff

diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h
--- a/sys/dev/vt/vt.h
+++ b/sys/dev/vt/vt.h
@@ -442,7 +442,8 @@
/* Sysmouse. */
void sysmouse_process_event(mouse_info_t *mi);
#ifndef SC_NO_CUTPASTE
-void vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel);
+void vt_mouse_event(int type, int x, int y, int z, int event, int cnt,
+ int mlevel);
void vt_mouse_state(int show);
#endif
#define VT_MOUSE_SHOW 1
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -2333,9 +2333,10 @@
}
static void
-vt_mouse_terminput(struct vt_device *vd, int type, int x, int y, int event,
- int cnt)
+vt_mouse_terminput(struct vt_device *vd, int type, int x, int y, int z,
+ int event, int cnt)
{
+ int button, i, wheel_events;
switch (type) {
case MOUSE_BUTTON_EVENT:
@@ -2352,17 +2353,14 @@
vt_mouse_terminput_button(vd, 3);
}
break;
-#ifdef notyet
case MOUSE_MOTION_EVENT:
- if (mouse->u.data.z < 0) {
- /* Scroll up. */
- sc_mouse_input_button(vd, 64);
- } else if (mouse->u.data.z > 0) {
- /* Scroll down. */
- sc_mouse_input_button(vd, 65);
- }
+ if (z == 0)
+ break;
+ button = z > 0 ? 64 : 65;
+ wheel_events = z > 0 ? z : -z;
+ for (i = 0; i < wheel_events; i++)
+ vt_mouse_terminput_button(vd, button);
break;
-#endif
}
}
@@ -2384,7 +2382,7 @@
}
void
-vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel)
+vt_mouse_event(int type, int x, int y, int z, int event, int cnt, int mlevel)
{
struct vt_device *vd;
struct vt_window *vw;
@@ -2413,7 +2411,7 @@
*/
if (vw->vw_mouse_level > 0)
- vt_mouse_terminput(vd, type, x, y, event, cnt);
+ vt_mouse_terminput(vd, type, x, y, z, event, cnt);
switch (type) {
case MOUSE_ACTION:
diff --git a/sys/dev/vt/vt_sysmouse.c b/sys/dev/vt/vt_sysmouse.c
--- a/sys/dev/vt/vt_sysmouse.c
+++ b/sys/dev/vt/vt_sysmouse.c
@@ -280,8 +280,8 @@
#ifndef SC_NO_CUTPASTE
mtx_unlock(&sysmouse_lock);
- vt_mouse_event(mi->operation, x, y, mi->u.event.id, mi->u.event.value,
- sysmouse_level);
+ vt_mouse_event(mi->operation, x, y, z, mi->u.event.id,
+ mi->u.event.value, sysmouse_level);
return;
#endif

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 13, 4:15 PM (16 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38857384
Default Alt Text
D59607.id186501.diff (2 KB)

Event Timeline