summaryrefslogtreecommitdiff
path: root/sys/dev/syscons/scmouse.c
Commit message (Collapse)AuthorAgeFilesLines
* syscons: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365088
* Remove the Yarrow PRNG algorithm option in accordance with due noticeMark Murray2018-08-261-1/+1
| | | | | | | | | | | | | | | | | | | given in random(4). This includes updating of the relevant man pages, and no-longer-used harvesting parameters. Ensure that the pseudo-unit-test still does something useful, now also with the "other" algorithm instead of Yarrow. PR: 230870 Reviewed by: cem Approved by: so(delphij,gtetlow) Approved by: re(marius) Differential Revision: https://reviews.freebsd.org/D16898 Notes: svn path=/head/; revision=338324
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Trival style fix to previous commit to add this detail.Bruce Evans2017-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The previous commit also fixed the coordinates passed to the mouse removal renderer. The coordinates were rounded down to a character boundary, and thus essentially unusable. The renderer had to keep track of the previous position, or clear a larger area. The latter is only safe in the border, which is all that needs special handling anyway. I think no renderer depends on the bug. They have the following handling: - gfb sparc64: this seems to assume non-rounded coordinates - gfb other: does nothing (seems to be missing border handling) - vga text: does nothing (doesn't need border handling) - vga planar: clears extras in the border, with some bugs. The fixes will use the precise coordinates to optimize. - vga direct: clears at the previous position with no check that it is active, and clears everything. Checking finds this bug. - others: are there any? Notes: svn path=/head/; revision=316736
* Fix removing of the mouse image in vga planar mode with 8x8 fonts, andBruce Evans2017-04-121-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | reduce hard-coded assumptions on font sizes so that the cursor size can be more independent of the font size. Moving the mouse in the buggy mode left trails of garbage. The mouse cursor currently has size 9x13 in all modes. This can occupy 2x3 character cells with 8x8 fonts, but the algorithm was hard-coded for only 2x2 character cells. Rearrange to hard-code only a maximum cursor size (now 10x16) and to not hard-code in the logic. The number of cells needed is now over-estimated in some cases. 2x3 character cells should also be used in text mode with 8x8 fonts (except with large pixels, the cursor size should be reduced), but hard-coding for 2x2 in the implementation makes it not very easy to expand, and it practice it shifts out bits to reduce to 2x2. In graphics modes, expansion is easier and there is no shifting out for 9x13 cursors (but 9 is a limit for hard-coding for 2 8-bit VGA cells wide). A previous commit removed the same buggy hard-coding for removal at a lower level in planar mode. Another previous commit fixed the much larger code for lower-level removal in direct mode; this is independent of the font size so worked for 8x8 fonts. Text mode always depended on the higher-level removal here, and always worked since everything was hard-coded consistently for 2x2 character cells. Notes: svn path=/head/; revision=316735
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-2/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* sys: Make use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni2016-04-301-3/+3
| | | | | | | No functional change. Notes: svn path=/head/; revision=298848
* Huge cleanup of random(4) code.Mark Murray2015-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * GENERAL - Update copyright. - Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set neither to ON, which means we want Fortuna - If there is no 'device random' in the kernel, there will be NO random(4) device in the kernel, and the KERN_ARND sysctl will return nothing. With RANDOM_DUMMY there will be a random(4) that always blocks. - Repair kern.arandom (KERN_ARND sysctl). The old version went through arc4random(9) and was a bit weird. - Adjust arc4random stirring a bit - the existing code looks a little suspect. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Redo read_random(9) so as to duplicate random(4)'s read internals. This makes it a first-class citizen rather than a hack. - Move stuff out of locked regions when it does not need to be there. - Trim RANDOM_DEBUG printfs. Some are excess to requirement, some behind boot verbose. - Use SYSINIT to sequence the startup. - Fix init/deinit sysctl stuff. - Make relevant sysctls also tunables. - Add different harvesting "styles" to allow for different requirements (direct, queue, fast). - Add harvesting of FFS atime events. This needs to be checked for weighing down the FS code. - Add harvesting of slab allocator events. This needs to be checked for weighing down the allocator code. - Fix the random(9) manpage. - Loadable modules are not present for now. These will be re-engineered when the dust settles. - Use macros for locks. - Fix comments. * src/share/man/... - Update the man pages. * src/etc/... - The startup/shutdown work is done in D2924. * src/UPDATING - Add UPDATING announcement. * src/sys/dev/random/build.sh - Add copyright. - Add libz for unit tests. * src/sys/dev/random/dummy.c - Remove; no longer needed. Functionality incorporated into randomdev.*. * live_entropy_sources.c live_entropy_sources.h - Remove; content moved. - move content to randomdev.[ch] and optimise. * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h - Remove; plugability is no longer used. Compile-time algorithm selection is the way to go. * src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h - Add early (re)boot-time randomness caching. * src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h - Remove; no longer needed. * src/sys/dev/random/uint128.h - Provide a fake uint128_t; if a real one ever arrived, we can use that instead. All that is needed here is N=0, N++, N==0, and some localised trickery is used to manufacture a 128-bit 0ULLL. * src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h - Improve unit tests; previously the testing human needed clairvoyance; now the test will do a basic check of compressibility. Clairvoyant talent is still a good idea. - This is still a long way off a proper unit test. * src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h - Improve messy union to just uint128_t. - Remove unneeded 'static struct fortuna_start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) * src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h - Improve messy union to just uint128_t. - Remove unneeded 'staic struct start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) - Fix some magic numbers elsewhere used as FAST and SLOW. Differential Revision: https://reviews.freebsd.org/D2025 Reviewed by: vsevolod,delphij,rwatson,trasz,jmg Approved by: so (delphij) Notes: svn path=/head/; revision=284959
* Snapshot. This passes the build test, but has not yet been finished or debugged.Mark Murray2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. Submitted by: Arthur Mesh <arthurmesh@gmail.com> (the first item) Notes: svn path=/projects/random_number_generator/; revision=256042
* In order to maximize the re-usability of kernel code in user space thisKip Macy2011-09-161-2/+2
| | | | | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz) Notes: svn path=/head/; revision=225617
* Add support for VT200-style mouse input.Ed Schouten2009-09-271-0/+52
| | | | | | | | | | | | | | | | | | | | | | Right now if applications want to use the mouse on the command line, they use sysmouse(4) and install a signal handler in the kernel to deliver signals when mouse events arrive. This conflicts with my plan to change to TERM=xterm, so implement proper VT200-style mouse input. Because mouse input is now streamed through the TTY, it means you can now SSH to another system on the console and use the mouse there as well. The disadvantage of the VT200 mouse protocol, is that it doesn't seem to generate events when moving the cursor. Only when pressing and releasing mouse buttons. There are different protocols as well, but this one seems to be most commonly supported. Reported by: Paul B. Mahol <onemda gmail com> Tested with: vim(1) Notes: svn path=/head/; revision=197539
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.Ed Schouten2008-08-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan Notes: svn path=/head/; revision=181905
* Make the comparsion more obvious.Xin LI2007-05-251-1/+2
| | | | Notes: svn path=/head/; revision=169983
* Introduce a spinlock for synchronizing access to the video output hardwareScott Long2006-09-131-4/+4
| | | | | | | | | | | | in syscons. This replaces a simple access semaphore that was assumed to be protected by Giant but often was not. If two threads that were otherwise SMP-safe called printf at the same time, there was a high likelyhood that the semaphore would get corrupted and result in a permanently frozen video console. This is similar to what is already done in the serial console drivers. Notes: svn path=/head/; revision=162285
* Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_tMarius Strobl2005-09-281-0/+1
| | | | | | | | | | | | | | | | | | | and do some preparations for handling 12x22 fonts (currently lots of code implies and/or hardcodes a font width of 8 pixels). This will be required on sparc64 which uses a default font size of 12x22 in order to add font loading and saving support as well as to use a syscons(4)-supplied mouse pointer image. This API breakage is committed now so it can be MFC'ed in time for 6.0 and later on upcoming framebuffer drivers destined for use on sparc64 and which are expected to rely on using font loading internally and on a syscons(4)-supplied mouse pointer image can be easily MFC'ed to RELENG_6 rather than requiring a backport. Tested on: i386, sparc64, make universe MFC after: 1 week Notes: svn path=/head/; revision=150686
* In set_mouse_pos(), try to avoid division by zero errors.Craig Rodrigues2005-09-071-1/+2
| | | | Notes: svn path=/head/; revision=149855
* Prevent division by zero errors in sc_mouse_move()Craig Rodrigues2005-08-301-1/+1
| | | | | | | | | | | | | by explicitly setting sc->font_width, in the same places where sc->font_size is set, instead of relying on the default initialized value of 0 for sc->font_width. PR: kern/84836 Reported by: Andrey V. Elsukov <bu7cher at yandex dot ru> MFC after: 2 days Notes: svn path=/head/; revision=149640
* Add VESA mode support for syscons, which enables the support of 15, 16,Xin LI2005-05-291-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | 24, and 32 bit modes. To use that, syscons(4) must be built with the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a. vesa.ko) must be either loaded, or be compiled into the kernel. Do not return EINVAL when the mouse state is changed to what it already is, which seems to cause problems when you have two mice attached, and applications are not likely obtain useful information through the EINVAL caused by showing the mouse pointer twice. Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is the video mode number from the vidcontrol -i mode output. Also, revert the video mode if something fails. Obtained from: DragonFlyBSD Discussed at: current@ with patch attached [1] PR: kern/71142 [2] Submitted by: Xuefeng DENG <dsnofe at msn com> [1], Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2] Notes: svn path=/head/; revision=146736
* Use __FBSDID().David E. O'Brien2003-08-241-2/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119420
* - Add a font width field to struct scr_stat. Use this instead of '8'.Jake Burkholder2003-08-241-7/+9
| | | | | | | | - Use the values in the video info for the font size and width instead of second guessing. Notes: svn path=/head/; revision=119388
* Use SC_NO_CUTPASTE to protect cutpaste variables correctly, fixing theJuli Mallett2003-06-011-2/+4
| | | | | | | | | | -Werror build with such option, but not other combinations. LINT misses this because syscons knobs in LINT turn off a lot of code. Reviewed by: marcel (some time ago) Notes: svn path=/head/; revision=115595
* Deprecate machine/limits.h in favor of new sys/limits.h.Alexander Kabaev2003-04-291-1/+1
| | | | | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com> Notes: svn path=/head/; revision=114216
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-1/+1
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-1/+1
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Use machine/limits.h rather than userland limits.h (which may come fromPeter Wemm2002-08-221-1/+1
| | | | | | | the userland source tree, or even worse: /usr/include) Notes: svn path=/head/; revision=102290
* In the word selection mode don't append newline if the word ends at theMaxim Sobolev2002-01-051-0/+4
| | | | | | | screen boundary. Notes: svn path=/head/; revision=88926
* Fix POLA - when selecting line into syscons' cut'n'paste buffer (doubleMaxim Sobolev2001-11-251-0/+4
| | | | | | | | | click) do not include newline into the buffer. This is exacly how things worked before my recent changes to the cut'n'paste code and how they work in 4-STABLE. Notes: svn path=/head/; revision=86894
* Introduce new syscons(4) kernel options:Maxim Sobolev2001-09-211-100/+91
| | | | | | | | | | | | | | | | - SC_CUT_SPACES2TABS - when copying text into the cut buffer convert leading spaces into the tabs; - SC_CUT_SEPCHARS="XYZ" - treat supplied characters as possible words separators when the driver searches for words boundaries when doing cut operation. Also unify cut code a bit to decrease amount of duplicated code. This fixes line cut mode, so that it is no longer pads line with useless spaces. Approved by: ru Notes: svn path=/head/; revision=83791
* KSE Milestone 2Julian Elischer2001-09-121-3/+3
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Fix dependencies between kernel options:Kazutaka YOKOTA2001-07-101-2/+0
| | | | | | | | | | | | | - When both SC_PIXEL_MODE and SC_NO_FONT_LOADING are defined, quietly drop SC_NO_FONT_LOADING, because the pixel(raster) console requires font. - When SC_NO_FONT_LOADING is defined, force SC_ALT_MOUSE_IMAGE. Without font, the arrow-shaped mouse cursor cannot be drawn. - Fiddle and simplify some internal macros. MFC after: 2 weeks Notes: svn path=/head/; revision=79534
* Quit the ioctl MOUSE_GETINFO as soon as we have gathered necessaryKazutaka YOKOTA2001-06-291-1/+1
| | | | | | | | information. There is no need to stick around any longer. MFC after: 2 weeks Notes: svn path=/head/; revision=78951
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-5/+7
| | | | | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations) Notes: svn path=/head/; revision=76166
* Change the pfind() and zpfind() functions to lock the process that theyJohn Baldwin2001-04-241-8/+9
| | | | | | | | | find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake Notes: svn path=/head/; revision=75893
* Upper limit of mousechar start is UCHAR_MAX - 3, not UCHAR_MAX - 4Andrey A. Chernov2001-04-211-2/+4
| | | | | | | | | | Restore original characters when mousechar start changes, not always 0-3 PR: 24437 Submitted by: Cejka Rudolf <cejkar@dcse.fee.vutbr.cz> Notes: svn path=/head/; revision=75790
* Multiply empty lines pasted as single line, fix itAndrey A. Chernov2001-03-131-2/+2
| | | | Notes: svn path=/head/; revision=74208
* Don't require that mouse cursor must be visible before mouse paste.Andrey A. Chernov2001-03-121-2/+1
| | | | | | | | | Paste always happens to current _text_ cursor position independently of mouse cursor position in any case and old variant force user to press mouse paste button _two_ times if mouse cursor is invisible. Notes: svn path=/head/; revision=74125
* Implement keyboard pasteAndrey A. Chernov2001-03-111-5/+4
| | | | | | | | PR: 25499 Submitted by: Gaspar Chilingarov <nm@web.am> Notes: svn path=/head/; revision=74118
* Grab the process lock while calling psignal and before calling psignal.John Baldwin2001-03-071-0/+4
| | | | Notes: svn path=/head/; revision=73929
* Initiate deorbit burn sequence for <machine/mouse.h>.Poul-Henning Kamp2000-10-091-2/+1
| | | | | | | | | | | | | Replace all in-tree uses with <sys/mouse.h> which repo-copied a few moments ago from src/sys/i386/include/mouse.h by peter. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/mouse.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/mouse.h> files will be removed. Notes: svn path=/head/; revision=66860
* Initiate deorbit burn sequence for <machine/console.h>.Poul-Henning Kamp2000-10-081-1/+2
| | | | | | | | | | | | Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/console.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/console.h> files will be removed. Notes: svn path=/head/; revision=66834
* Harvest mouse events for the entropy device in a better place. In theMark Murray2000-09-101-0/+4
| | | | | | | | | new location, all mouse events are harvested, not just the ones being written out to moused(8). This means that mouse entropy is harvested at the consoles as well as in X. Notes: svn path=/head/; revision=65690
* - Fix SC_ALT_MOUSE_IMAGE; don't blink the mouse cursor.Kazutaka YOKOTA2000-03-311-17/+13
| | | | | | | - Fix non-destructive, underline text cursor. Notes: svn path=/head/; revision=58872
* Use config's conditional compilation rather than using #ifdefs that makePeter Wemm2000-01-291-5/+0
| | | | | | | | modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code. Notes: svn path=/head/; revision=56836
* Fix a bug exposed by the previous commit. Do not use scp->font_size,Kazutaka YOKOTA2000-01-241-2/+5
| | | | | | | | | if the screen is in a graphics mode Reported by: Maxim Sobolev <sobomax@altavista.net> Notes: svn path=/head/; revision=56528
* Fix wrong usage of FONT_NONE. It was not meant to be set inKazutaka YOKOTA2000-01-201-1/+1
| | | | | | | | | | scp->font_size in the first place. It is redundant now and is removed. Found by: bde Notes: svn path=/head/; revision=56328
* This is the 3rd stage of syscons code reorganization.Kazutaka YOKOTA2000-01-151-201/+15
| | | | | | | | | | | | | | | | | | - Split terminal emulation code from the main part of the driver so that we can have alternative terminal emulator modules if we like in the future. (We are not quite there yet, though.) - Put sysmouse related code in a separate file, thus, simplifying the main part of the driver. As some files are added to the source tree, you need to run config(8) before you compile a new kernel next time. You shouldn't see any functional change by this commit; this is only internal code reorganization. Notes: svn path=/head/; revision=56043
* Make the mouse cursor char code configurable via the CONS_MOUSECTLKazutaka YOKOTA2000-01-121-0/+18
| | | | | | | | | ioctl. By popular demand. Notes: svn path=/head/; revision=55849
* Fix mouse cursor logic which I broke in 1.1 ;-<Kazutaka YOKOTA1999-12-061-26/+30
| | | | | | | Reported by: Christian Weisgerber <naddy@unix-ag.uni-kl.de> Notes: svn path=/head/; revision=54182
* Correctly record the mouse position in the current VTY.Kazutaka YOKOTA1999-11-091-23/+22
| | | | Notes: svn path=/head/; revision=53057
* - Added a new kernel configuration option: SC_TWOBUTTON_MOUSE.Kazutaka YOKOTA1999-11-081-2/+10
| | | | | | | | | | The new option will make the right mouse button the `paste' button. Useful for two button mice. Submitted by: morganw@engr.sc.edu (Wes Morgan) Notes: svn path=/head/; revision=53011