Your mouse and the mouse driver may have somewhat become out of synchronization.
In versions 2.2.5 and earlier, switching away from X to a virtual terminal and getting back to X again may make them re-synchronized. If the problem occurs often, you may add the following option in your kernel configuration file and recompile it.
See the section on building a kernel if you have no experience with building kernels.
With this option, there should be less chance of synchronization problem between the mouse and the driver. If, however, you still see the problem, click any mouse button while holding the mouse still to re-synchronize the mouse and the driver.
Note that unfortunately this option may not work with all the systems and voids the ``tap'' feature of the ALPS GlidePoint device attached to the PS/2 mouse port.
In versions 2.2.6 and later, synchronization check is done in a slightly better way and is standard in the PS/2 mouse driver. It should even work with GlidePoint. (As the check code has become a standard feature, PSM_CHECKSYNC option is not available in these versions.) However, in rare case the driver may erroneously report synchronization problem and you may see the kernel message:
psmintr: out of sync (xxxx != yyyy)
and find your mouse does not seem to work properly.
If this happens, disable the synchronization check code by setting the driver flags for the PS/2 mouse driver to 0x100. Enter UserConfig by giving the -c option at the boot prompt:
Then, in the UserConfig command line, type:
UserConfig> flags psm0 0x100 UserConfig> quit