THIS SECTION IS UNDER CONSTRUCTION
- Mouse relative position - Trackball - Joystick - Digitizer/Tablet/Touch pad absolute position - Light Pen - Touch Screen 2D устройства ввода
Мышь
Принцип работы мыши:
Принцип работы оптической мыши:
Что видит оптическая мышь:
Trackball:
Serial Mouse connector
DB9 DB25 Mouse Signal COM-port signal 2 3 Data RD 5 7 GND GND 7(4) 4(20) +Vcc RTS(DTR) 3 2 -Vcc TD
PS/2 Mouse connector
/--+--\ 1 Mouse Data / 6 X 5 \ 2 |4 X 3| 3 GND \ 2 1 / 4 Vcc (+5V) +-----+ 5 Mouse clock 6
SERIAL MOUSE PROTOCOLS
Microsoft Serial Mouse have 2 buttons. 1200 baud, 7 bit word len, parity off 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+ | 1 | L | R | Y7 | Y6 | X7 | X6 | +0000 +----+----+----+----+----+----+----+ | 0 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+ | 0 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+ Microsoft Serial Mouse
Microsoft Serial Mouse+ have 3 buttons. 1200 baud, 7 bit word len, parity off 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+ | 1 | L | R | Y7 | Y6 | X7 | X6 | +0000 +----+----+----+----+----+----+----+ | 0 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+ | 0 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+ | 0 | M | 0 | 0 | 0 | 0 | 0 | +0003 +----+----+----+----+----+----+----+ Microsoft Serial Mouse +
1200 baud, 7 bit word len, parity off 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+ | 1 | L | R | Y7 | Y6 | X7 | X6 | +0000 +----+----+----+----+----+----+----+ | 0 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+ | 0 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+ | 0 | 0 | R0 | Z3 | Z2 | Z1 | Z0 | +0003 +----+----+----+----+----+----+----+ 3D Serial Mouse
PC Mouse have 3 buttons. 1200 baud, 8 bit, parity off 7 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+----+ | 1 | 0 | 0 | 0 | 0 | L | M | R | +0000 +----+----+----+----+----+----+----+----+ | X7'| X6'| X5'| X4'| X3'| X2'| X1'| X0'| +0001 +----+----+----+----+----+----+----+----+ | Y7'| Y6'| Y5'| Y4'| Y3'| Y2'| Y1'| Y0'| +0002 +----+----+----+----+----+----+----+----+ | X7"| X6"| X5"| X4"| X3"| X2"| X1"| X0"| +0003 +----+----+----+----+----+----+----+----+ | Y7"| Y6"| Y5"| Y4"| Y3"| Y2"| Y1"| Y0"| +0004 +----+----+----+----+----+----+----+----+ PC Mouse
PS/2 MOUSE PROTOCOLS
7 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+----+ | YV | XV | YS | XS | 1 | M' | R | L | +0000 +----+----+----+----+----+----+----+----+ | X7 | X6 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+----+ | Y7 | Y6 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+----+ PS/2 Standart Mouse
7 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+----+ | 0 | 0 | YS | XS | 1 | M | R | L | +0000 +----+----+----+----+----+----+----+----+ | X7 | X6 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+----+ | Y7 | Y6 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+----+ | Z7 | Z6 | Z5 | Z4 | Z3 | Z2 | Z1 | Z0 | +0003 +----+----+----+----+----+----+----+----+ 3D PS/2 Mouse
7 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+----+ | 0 | 0 | YS | XS | 1 | M | R | L | +0000 +----+----+----+----+----+----+----+----+ | X7 | X6 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+----+ | Y7 | Y6 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+----+ | 0 | 0 | B5 | B4 | Z3 | Z2 | Z1 | Z0 | +0003 +----+----+----+----+----+----+----+----+ PS/2 Wheel Mouse
USB MOUSE PROTOCOLS USB Mouse is HID device: 03h class HID 01h subclass BootDevices 02h protocol Mouse Mouse send Reports via Interrupt transfers.
Here is format of first bytes of report: 7 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+----+ | Vendor specific | M | R | L | +0000 +----+----+----+----+----+----+----+----+ | X7 | X6 | X5 | X4 | X3 | X2 | X1 | X0 | +0001 +----+----+----+----+----+----+----+----+ | Y7 | Y6 | Y5 | Y4 | Y3 | Y2 | Y1 | Y0 | +0002 +----+----+----+----+----+----+----+----+ = = +----+----+----+----+----+----+----+----+
Touch Pad
TouchPad - устройство близкое к мышке, разница в том, что TouchPad, так же как TouchScreen и LightPen - возвращает абсолютные координаты перемещения (мышь возвращает относительные). Примеры пакета TouchPad в режиме относительных координат:
Примеры пакета TouchPad в режиме абсолютных координат:
Джойстик
(а так же руль с педалями)
смотри также секцию 56.9 - Game Port. Раньше Joystikи вешались на Game Port. Сейчас это USB устройства c стандартизированным протоколом.
Формат репорта Joysticka: USB Joystick is HID Device. 03h class HID 01h subclass BootDevices 04h protocol Joystick 7 6 5 4 3 2 1 0 +----+----+----+----+----+----+----+----+ | X Position | +----+----+----+----+----+----+----+----+ | Y Position | +----+----+----+----+----+----+----+----+ | B4 | B3 | B2 | B1 | | +----+----+----+----+----+----+----+----+ | Throttle | +----+----+----+----+----+----+----+----+ Joystikи c большем числок кнопок, рули педали имеют расширенные версии репорта - но они уже device depended.
- Dataglove (6 degree of freedom) - Head mounting display - Space ball 3D устройства ввода