.\" $NetBSD: btmagic.4,v 1.6 2015/07/03 22:18:02 wiz Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Iain Hibbert. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd July 4, 2015 .Dt BTMAGIC 4 .Os .Sh NAME .Nm btmagic .Nd Apple Magic Mouse and Apple Magic Trackpad .Sh SYNOPSIS .Cd "btmagic* at bthub?" .Cd "wsmouse* at btmagic?" .Sh DESCRIPTION The .Nm driver provides support for the .Tn Bluetooth .Dq Magic Mouse and .Dq Magic Trackpad from .Tn Apple, Inc . As remote devices cannot be discovered by autoconfig, configuring a mouse is normally carried out with the .Xr btdevctl 8 program. .Pp The Magic Mouse and Magic Trackpad use the standard .Tn USB Human Interface Device protocol to communicate, but do not provide a proper HID Descriptor, and require specific initializations to enable the proprietary touch reports. .Pp The Magic Mouse provides basic mouse functionality with two buttons, and the .Nm driver additionally interprets the touch reports to emulate a middle mouse button when more than one firm touch is detected during a click event, plus horizontal and vertical scrolling for touch movements greater than a certain distance. The mouse has a base resolution of 1300dpi, which the driver scales by default to a less sensitive 650dpi, but this is adjustable with .Xr sysctl 8 along with the pressure needed to discern a firm touch, the minimum distance necessary to trigger scrolling and the additional downscale factor applied to scroll movements. .Pp The Magic Trackpad provides multi touch functionality and one button. The .Nm driver emulates 3 buttons by splitting the area at the bottom of the device in 3 equal zones and detects finger presence in one of these zones when the button is pressed. In addition, a tap in any area of the trackpad is interpreted as a left click. The timeout for tap detection defaults to 100ms and is adjustable with .Xr sysctl 8 . .Pp Pointer movement is reported for single-touch movements over the device, and scroll is reported for multi-touch movements. .Pp The trackpad has a base resolution of 1300dpi, which the driver scales by default to a less sensitive 650dpi, but this is adjustable with .Xr sysctl 8 along with the additional downscale factor applied to scroll movements. .Pp .Nm interfaces to the system as usual through the .Xr wsmouse 4 driver, and the following properties are used during autoconfiguration: .Bl -tag -width ".It remote-bdaddr" .It vendor-id Must be 0x05ac. .It product-id Must be 0x030d or 0x030e. .It local-bdaddr Local device address. .It remote-bdaddr Remote device address. .It link-mode This optional string represents the link mode of the baseband link, and may be one of .Sq auth , .Sq encrypt , or .Sq secure . .El .Pp When the .Nm driver has configured, it will attempt to open a connection to the mouse and, if this fails or the connection is lost, will wait for the mouse to initiate connections. The Magic Mouse requires connections to be authenticated, and should accept a PIN of .Sq 0000 during the pairing process. .Sh SEE ALSO .Xr bluetooth 4 , .Xr bthub 4 , .Xr wsmouse 4 , .Xr btdevctl 8 , .Xr sysctl 8 .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Iain Hibbert with reference to the .Tn Linux driver written by .An Michael Poole . .An Manuel Bouyer added Magic Trackpad support, with reference to the .Tn Linux driver written by .An Michael Poole and .An Chase Douglas .