sysmouse.c (a909184e9dd59e1176a5556a64d2ec02014c79ae) sysmouse.c (7aa4389a6c7429f679ba5d0348c4251242ed4702)
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 320 unchanged lines hidden (view full) ---

329 buf[6] = (z - (z >> 1)) & 0x7f;
330 /* buttons 4-10 */
331 buf[7] = (~mouse_status.button >> 3) & 0x7f;
332 for (i = MOUSE_MSC_PACKETSIZE; i < MOUSE_SYS_PACKETSIZE; ++i)
333 (*linesw[sysmouse_tty->t_line].l_rint)(buf[i],
334 sysmouse_tty);
335 }
336
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 320 unchanged lines hidden (view full) ---

329 buf[6] = (z - (z >> 1)) & 0x7f;
330 /* buttons 4-10 */
331 buf[7] = (~mouse_status.button >> 3) & 0x7f;
332 for (i = MOUSE_MSC_PACKETSIZE; i < MOUSE_SYS_PACKETSIZE; ++i)
333 (*linesw[sysmouse_tty->t_line].l_rint)(buf[i],
334 sysmouse_tty);
335 }
336
337 /* do the /dev/random device a favour */
338 /* The nasty-looking cast is to force treatment of 8 u_chars */
339 /* in buf as a u_int64_t */
340 random_harvest(*((u_int64_t *)buf), 2, 0, RANDOM_MOUSE);
337 random_harvest(buf, sizeof(buf), 2, 0, RANDOM_MOUSE);
341
342 return mouse_status.flags;
343}
344
345#endif /* !SC_NO_SYSMOUSE */
338
339 return mouse_status.flags;
340}
341
342#endif /* !SC_NO_SYSMOUSE */