History log of /freebsd-current/sys/sys/mouse.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 5bff3b69 18-Jan-2019 Vladimir Kondratyev <wulf@FreeBSD.org>

psm(4): detect Lenovo top-button clickpads

libinput has special handling for Lenovo ThinkPad *40 series, where it
treats clicks on the top button area as if they came from the TrackPoint:
https://wayland.freedesktop.org/libinput/doc/latest/t440-support.html

Detect these devices and set the corresponding evdev property.

Submitted by: Greg V <greg@unrelenting.technology>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18676


# 8c6d2039 23-Oct-2018 Warner Losh <imp@FreeBSD.org>

For the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
some ports can be updated.


# c1cdf6a4 21-Oct-2018 Warner Losh <imp@FreeBSD.org>

Remove mse(4) from tree

Remove mse and all support for bus and inport devices from the tree.
Data from nycbug's dmesg database shows the last sighting of this
driver was in 4.10 on only one machine.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D17628


# 67580198 10-Jun-2018 Vladimir Kondratyev <wulf@FreeBSD.org>

Drop MOUSE_GETVARS and MOUSE_SETVARS ioctls support.

These ioctls are not documented and only stubbed in a few drivers: mse(4),
psm(4) and syscon's sysmouse(4). The only exception is MOUSE_GETVARS
implemented in psm(4)

Given the fact that they were introduced 20 years ago and implementation
has never been completed, remove any related code.

PR: 228718 (exp-run)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D15726


# 7d1460a4 31-Jan-2018 Vladimir Kondratyev <wulf@FreeBSD.org>

psm(4): Add support for HP EliteBook 1040 ForcePads.

ForcePads do not have any physical buttons, instead they detect click
based on finger pressure. Forcepads erroneously report button click
if there are 2 or more fingers on the touchpad breaking multifinger
gestures. To workaround this start reporting a click only after
4 consecutive single touch packets has been received. Skip these packets
in case more contacts appear.

PR: 223369
Reported by: Neel Chauhan <neel@neelc.org>
Tested by: Neel Chauhan <neel@neelc.org>
Reviewed by: gonzo
Approved by: gonzo


# 9b10f59a 13-Dec-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

SPDX: mostly fixes to previous changes.

Introduce the recently approved BSD-1-Clause and replace 0BSD which
never did fit well our use cases.


# 0fe98e8f 26-Sep-2016 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Add Elantech trackpad support

Elantech trackpads are found in some laptops like the Asus UX31E. They
are "synaptics compatible" but use a slightly different protocol.

Elantech hardware support is not enabled by default and just like
Synaptic or TrackPoint devices it should be enabled by setting
tunable, in this case hw.psm.elantech_support, to non-zero value

PR: 205690
Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 1 week


# 017d4859 10-May-2015 Rui Paulo <rpaulo@FreeBSD.org>

synaptics: more support for semi-MT trackpads.

Several improvements to the Synaptics driver to support
semi-multitouch trackpads and some other fixes:

- Two finger scrolling support for "semi-MT" touchpads. Those include
many of the older Synaptics touchpads before "true" multitouch support
(indicated by capMultiFinger). Semi-MT touchpads can report a second
finger position, but the X or Y coordinate may be swapped with some
coordinate of the first finger. This is a result of how the hardware
works internally. Therefore, all that can be reliably extracted is the
bounding box of the two finger positions. Semi-MT touchpads can be
recognized by the capAdvancedGestures capability bit. After setting the
mode byte, advanced gestures mode has to be enabled. Then, data packets
compatible with the capMultiFinger format are sent, so the same two
finger scrolling code can be leveraged. Enabling advanced gestures mode
on true multitouch touchpads should be harmless. Linux seems to always
enable advanced gestures mode.

- Put mode setting logic into own functions synaptics_preferred_mode()
and synaptics_set_mode() to have this in one place.
synaptics_passthrough_on() and synaptics_passthrough_off() currently
always use 0xc1 as the mode byte, which may be wrong for touchpads that
don't have capExtended.

- Expose X and Y resolution of touchpad to userland. Also expose minimum
and maximum X and Y coordinates. This is useful for programs in
userspace that read raw PSM packets (with PSM_LEVEL_NATIVE enabled) and
need to interpret the coordinates.

- Also send "extended w mode" packets (see section 3.2.9 of
511-000275-01_RevB.pdf) to userspace if PSM_LEVEL_NATIVE is enabled.
This is useful for userspace programs/drivers such as
xf86-input-synaptics that can handle these packets.

- Fix parsing of nExtendedQueries, and request extended/continued
capability bits depending on this value.

- capReportsMax, capClearPad, capAdvancedGestures and capCoveredPad must
be extracted from status[0] and not status[2], I think.

Submitted by: Jan Kokemüller jan.kokemueller at gmail.com


# e1971180 11-Apr-2015 Rui Paulo <rpaulo@FreeBSD.org>

Improve Synaptics support for newer touchpads.

Enable two finger scrolling by default and disable the edge scrolling if
the touchpad has no physical zone for it. Disable directional scrolling
by default to avoid using extended buttons as scroll buttons.

Add support for ClickPad. On Lenovo laptops, this is the button
reported when one presses the touchpad.

While there, fix a problem where the extended buttons were not reporting
the button release event correctly: we need to save the state of the
buttons and report it to sysmouse until we receive a packet from the
touchpad indicating the button has been released. This makes it
possible to use an extended button to resize a window. On Lenovo
laptops, the major buttons are actually reported as extended buttons.

Tested by: many (current@)
MFC after: 1 week


# c282164d 05-Apr-2015 Rui Paulo <rpaulo@FreeBSD.org>

psm: print newer Synaptics Touchpad capabilities.


# c33c993b 02-Sep-2013 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

sys/mouse.h: Move members introduced in r255153 to end of struct synapticshw

I didn't know this structure was public and didn't pay enough attention...


# 79d98ecd 02-Sep-2013 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

psm: Add support for middle and extended buttons on Synaptics touchpads

PR: kern/170834
Submitted by: Brandon Gooch <jamesbrandongooch@gmail.com>
Tested by: Artyom Mirgorodskiy <artyom.mirgorodsky@gmail.com>
MFC after: 1 month


# 569d8f7e 18-Mar-2013 Jung-uk Kim <jkim@FreeBSD.org>

Add preliminary support for IBM/Lenovo TrackPoint.

PR: kern/147237 (based on the initial patch for 8.x)
Tested by: glebius (device detection and suspend/resume)
MFC after: 1 month


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 7810d9c6 18-Dec-2006 Giorgos Keramidas <keramida@FreeBSD.org>

Spell "Kensington Thinking Mouse" correctly.


# f4e98881 03-Dec-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fix -Wundef.


# ce99e877 13-Apr-2005 Matthew N. Dodd <mdodd@FreeBSD.org>

Support for the GTCO Digipad.


# 22c2b565 12-Dec-2004 Julian Elischer <julian@FreeBSD.org>

Don't export the 'dt' field as that would break the exisiting ABI.
keep the code but comment it out so that if the ABI changes we
can see easily what should be done.

Submitted by: iedowse


# c29b0a0f 11-Dec-2004 Julian Elischer <julian@FreeBSD.org>

Add support for USB Microsoft Intellimouse

PR: kern/70607
Submitted by: Matt Wright <matt@consultmatt.co.uk>
MFC after: 1 week


# a4cdf60c 29-Jul-2004 Nate Lawson <njl@FreeBSD.org>

Add support for the Synaptics Touchpad mouse driver. I reworked the
submitted version with style cleanups and changes to comments. I also
modified the ioctl interface. This version only has one ioctl (to get
the Synaptics-specific config parameters) since this is the only
information a user might want.

Submitted by: Arne Schwabe <arne -at- rfc2549.org>


# 05f92020 23-Mar-2002 Will Andrews <will@FreeBSD.org>

Minor changes:
[1] Support the Sony VAIO Jogdial in moused(8).
[2] Modify spic(4) to support additional Sony VAIO models.

Submitted by: [1] Juriy Goloveshkin <j@gu.ru>,
[2] Akira Funahashi <funa@funa.org>
Tested by: cjh, jim, Jerry A! <jerry@thehutt.org>
Approved by: nsayer
MFC after: 2 weeks


# 4c9cf96e 05-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Spelling police: extention -> extension in a comment.


# f6b5c74c 09-Oct-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Initiate deorbit burn sequence for <machine/mouse.h>.

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.


# 3346e881 18-Mar-2000 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Add Support for the following PS/2 mice:
- Microsoft IntelliMouse Explorer: 2 buttons on top, 2 side buttons
and a wheel which also acts as the middle button. The mouse is
recognized as "IntelliMouse Explorer".
- Genius NetScroll Optical: 2 buttons on top, 2 side buttons and a
wheel which also acts as the middle button. The mouse is recognized
as "NetMouse/NetScroll Optical".
- MouseSystems SmartScroll Mouse (OEM from Genius?): 3 buttons on top,
1 side button and a wheel. The mouse is recognized as Genius
"NetScroll".
- IBM ScrollPoint: 2 buttons on top and a stick between the buttons.
The stick can perform "horizontal scroll" in W*ndows environment.
The horizontal movement of the stick is detected. It is currently
mapped to the Z axis movement in the same way as the first wheel.
The mouse is recognized as "MouseMan+", as it is considered to be
a variation of MouseMan.
- A4 Tech 4D and 4D+ mice. These mice have two wheels! The movement
of the second wheel is reported as the Z axis movement in the
same way as the first wheel. These mice are recognized as "4D
Mouse" and "4D+ Mouse".
- Tweak IntelliMouse support code a bit so that less-than-compatible
wheel mice can work properly with the psm driver.
- Add driver configuration flags which correspond to the kernel
options PSM_HOOKRESUME and PSM_RESETAFTERSUSPEND, so that we don't
need to recompile the kernel when we need these functions.
- Properly keep track of the irq resource.
- Add a watchdog timer in case interrupts are lost (experimental).
- Add `detach' function (experimental).


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 64eed277 16-Aug-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Add definitions for Interlink VersaPad.


# 01533d85 12-Jul-1999 Kazutaka YOKOTA <yokota@FreeBSD.org>

Improve Logitech MouseMan+ protocol support.


# 73df5253 21-Feb-1999 Nick Hibma <n_hibma@FreeBSD.org>

1) Added define for USB as an interface
2) Added define for maximum number of buttons for Mouse Systems


# 1b11ca6c 20-Nov-1998 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Added support for Genius Kidspad tablet.

# `moused' is getting too over-loaded now. If we want something
# more than simple mouse emulation for tablets or remote devices,
# we should start writing a separate daemon...

Submitted by: luigi


# 67978692 14-Jun-1998 Amancio Hasty <ahasty@FreeBSD.org>

Reviewed by: Amancio
Submitted by: Randall Hopper <rhh@ct.picker.com>
The patch supports using the X10 Mouse Remote in both stand-alone and
pass-through configurations, so you can plug your mouse and remote into the
same serial port, use the mouse for X, and use the remote for other apps
like Fxtv. For instance, we can now control fxtv via the remote control
just like a TV : change channels, mute, increase volume, zoom video,
freeze frame 8)

The mouse events are channeled through the syscons/sysmouse I/F like
normal, and the remote buttons are "syphoned off" to a UNIX-domain stream
socket (defined as _PATH_MOUSEREMOTE in <machine/mouse.h>) for a
remote-aware app to grab and use.

For further info on the X10 Mouse Remote see:
http://www.x10.com/products/x10_mk19a.htm


# c6d1bed1 07-Dec-1997 Kazutaka YOKOTA <yokota@FreeBSD.org>

- Add support for the following mice to psm/moused/sysmouse:

MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+

- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.

- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.

- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.

- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.

/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.

/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.

/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.

/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.

/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.

/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.


# 63f87bd1 19-Oct-1997 Kazutaka YOKOTA <yokota@FreeBSD.org>

Rename MOUSE_GETINFO to MOUSE_GETHWINFO. The name collided with the one
in console.h.
Pointed out by bde.


# 6875d254 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# f0b608a7 04-Jan-1997 Nate Williams <nate@FreeBSD.org>

Minor white-space and comment cleanups. No functional change.

Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>


# 1f9d9075 01-Dec-1996 Søren Schmidt <sos@FreeBSD.org>

Alot of fixes from kazu:

1. All the suggestions earlier made by Bruce: renaming some symbols,
stricter error checking, removing redundant code, etc.

2. The `psm' driver preserves the default counter resolution and
report rate, whatever they are after reset. (Based on reports and
suggestion from Nate and Rob Bolin).

3. The `psm' driver now does not check the so-called sync. bit in the
first byte of the data packet by default, so that the tapping feature
of ALPUS GlidePoint works (based on reports from Louis Mamakos). I
tested the code with ALPUS Desktop GlidePoint (M/N GP101) and found
no problem; tapping worked. It appears ALPUS produces several models
of GlidePoint. I hope the other models are OK too.

The check code can still be activated by defining the PSM_CHECKSYNC
option in the config file. (The bit checking slightly reduces, if not
completely eliminates, weird mouse behavior cased by unsynchronized
mouse data packets. It also helps us to detect if the mouse interrupt
can ever be lost. But, well, if there are devices which cannot be
supported this way...)

4. The `psm' driver does not include the protocol emulation code by
default. The code can still be compiled in if the PSM_EMULATION option
is specified in the config file. Louis Mamakos suggests the emulation
code is putting too much in the kernel, and `moused' works well.
I will think about this later and decide if the entire emulation
code should be removed.

5. And, of course, the fix in `scprobe()' from Bruce to cure the
UserConfig problem. My code in `kbdio.c' is slightly different from
his patch, but has the same effect. There still is a possibility that
`scprobe()' gets confused, if, for whatever reasons, the user holds
down a key for very long time during the boot process. But we cannot
cope with everything, can we?

Submitted by: Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)


# 7e4de6f7 14-Nov-1996 Nate Williams <nate@FreeBSD.org>

KNF'ify.


# 6a90d975 14-Nov-1996 Søren Schmidt <sos@FreeBSD.org>

Finally a start at sharing the kdb controller routines between
syscons and psm, curtesy Kazutaka Yokota with minor changes by
me. This contains an update of the psm driver as well.
This also fixes the breakage that I introduced to the psm driver by
making syscons poll for keyboard events in the atempt to fix the
hanging keyboard problem.

It works perfectly for me, and I'd like to hear from all that
have had keyboard/ps/2 mouse problems if this is the cure...

Submitted by: Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)


# 010a751e 09-Sep-1994 Doug Rabson <dfr@FreeBSD.org>

Added the psm driver from 1.1.5.

Submitted by: dfr