Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/syscons/sysmouse.c
Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | static int butmap[8] = { | ||||
MOUSE_MSC_BUTTON2UP, | MOUSE_MSC_BUTTON2UP, | ||||
MOUSE_MSC_BUTTON1UP, | MOUSE_MSC_BUTTON1UP, | ||||
0, | 0, | ||||
}; | }; | ||||
u_char buf[8]; | u_char buf[8]; | ||||
int x, y, z; | int x, y, z; | ||||
int i, flags = 0; | int i, flags = 0; | ||||
tty_lock(sysmouse_tty); | ttydisc_lock(sysmouse_tty); | ||||
switch (info->operation) { | switch (info->operation) { | ||||
case MOUSE_ACTION: | case MOUSE_ACTION: | ||||
mouse_status.button = info->u.data.buttons; | mouse_status.button = info->u.data.buttons; | ||||
/* FALL THROUGH */ | /* FALL THROUGH */ | ||||
case MOUSE_MOTION_EVENT: | case MOUSE_MOTION_EVENT: | ||||
x = info->u.data.x; | x = info->u.data.x; | ||||
y = info->u.data.y; | y = info->u.data.y; | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | /* extended part */ | ||||
buf[6] = (z - (z >> 1)) & 0x7f; | buf[6] = (z - (z >> 1)) & 0x7f; | ||||
/* buttons 4-10 */ | /* buttons 4-10 */ | ||||
buf[7] = (~mouse_status.button >> 3) & 0x7f; | buf[7] = (~mouse_status.button >> 3) & 0x7f; | ||||
for (i = MOUSE_MSC_PACKETSIZE; i < MOUSE_SYS_PACKETSIZE; ++i) | for (i = MOUSE_MSC_PACKETSIZE; i < MOUSE_SYS_PACKETSIZE; ++i) | ||||
ttydisc_rint(sysmouse_tty, buf[i], 0); | ttydisc_rint(sysmouse_tty, buf[i], 0); | ||||
} | } | ||||
ttydisc_rint_done(sysmouse_tty); | ttydisc_rint_done(sysmouse_tty); | ||||
done: tty_unlock(sysmouse_tty); | done: ttydisc_unlock(sysmouse_tty); | ||||
return (flags); | return (flags); | ||||
} | } | ||||
#endif /* !SC_NO_SYSMOUSE */ | #endif /* !SC_NO_SYSMOUSE */ |