Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
open("/dev/kbd", O_RDWR)
The usbkbm STREAMS module processes byte streams generated by a keyboard attached to a USB port. USB keyboard is a member of Human Interface Device (HID) Class, and usbkbm only supports the keyboard protocol defined in the specification. Definitions for altering keyboard translation and reading events from the keyboard are in <sys/kbio.h> and <sys/kbd.h>.
The usbkbm STREAMS module adheres to the interfaces exported by kb(4M). Refer to the DESCRIPTION section of kb(4M) for a discussion of the keyboard translation modes and the IOCTL section for the supported ioctl(2) requests.
USB Keyboard usbkbm returns different values for the following ioctls than kb(4M): KIOCTYPE
This ioctl() returns a new keyboard type defined for the USB keyboard. All types are listed below:
KB_SUN3 Sun Type 3 keyboard KB_SUN4 Sun Type 4 keyboard KB_ASCII ASCII terminal masquerading as keyboard KB_PC Type 101 PC keyboard KB_USB USB keyboard
The USB keyboard type is KB_USB; usbkbm will return KB_USB in response to the KIOCTYPE ioctl. KIOCLAYOUT
The argument is a pointer to an int. The layout code specified by the bCountryCode value returned in the HID descriptor is returned in the int pointed to by the argument. The countrycodes are defined in 6.2.1 of the HID 1.0 specifications.
The kb(4M) indicates that inappropriate commands for particular keyboards are ignored. Because clicking is not supported on the USB keyboard, usbkbm ignores this command
Set keyboard LEDs. Same as kb(4M).
The country codes defined in 6.2.1 of the HID 1.0 specification are returned.
This command is supported although the USB keyboard does not have a buzzer. The request for the bell is rerouted.
There is no notion of resetting the keyboard as there is for the type4 keyboard. usbkbm ignores this command and does not return an error.
32-bit ELF kernel STREAMS module (x86 platform only)
SPARC 64-bit ELF kernel STREAMS module
See attributes(7) for a description of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Architecture PCI-based systems |
dumpkeys (1), kbd (1), loadkeys (1), ioctl (2), hid (4D), usba (4D), virtualkm (4D), kb (4M), keytables (5), attributes (7)
STREAMS Programming Guide
System Administration Guide: Basic Administration
None