Mouse Input: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
add a lot of text ( tables, whole command list..) and add some definations, however non clean up on structure .. |
m Corrected some grammar mistakes. |
||
Line 1: | Line 1: | ||
==PC Mouse Interfaces== |
==PC Mouse Interfaces== |
||
Current PCs generally use PS2 mice, or a similar format that emulates a PS2 mouse. Serial mice are a much |
Current PCs generally use PS2 mice, or a similar format that emulates a PS2 mouse. Serial mice are a much |
||
older technology that is no longer common. |
older technology that is no longer common. |
||
===USB Mouse=== |
===USB Mouse=== |
||
A USB mouse generally emulates a PS2 mouse, except that it generates IRQs from the USB bus, and not IRQ 12. |
A USB mouse generally emulates a PS2 mouse, except that it generates IRQs from the USB bus, and not IRQ 12. |
||
===PS2 Mouse -- Basic Operation (Microsoft compliant)=== |
===PS2 Mouse -- Basic Operation (Microsoft compliant)=== |
||
Once a mouse has been initialized (see below), a mouse sends 3 or 4 byte packets to communicate mouse |
Once a mouse has been initialized (see below), a mouse sends 3 or 4 byte packets to communicate mouse |
||
movement, and mouse button press/release events. These packets show up asynchronously as data on IO port 0x60. |
movement, and mouse button press/release events. These packets show up asynchronously as data on IO port 0x60. |
||
Line 161: | Line 158: | ||
===PS2 Mouse Commands=== |
===PS2 Mouse Commands=== |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
All output to port 0x60 or 0x64 must be preceded by waiting for bit number 1 (value=2) of port 0x64 to clear. |
|||
⚫ | |||
====0xD4 Byte and Command Byte==== |
====0xD4 Byte and Command Byte==== |
||
Line 174: | Line 169: | ||
====Wait for ACK from Mouse==== |
====Wait for ACK from Mouse==== |
||
It is required to wait until the mouse sends back |
It is required to wait until the mouse sends back the 0xFA acknowledgement byte after each command byte before sending the next 0xD4 (Note: reset commands might not be ACK'ed -- wait for the 0xAA after a reset). |
||
Some commands generate 2 ACK, 1 for the command, and 1 for receiving data. |
|||
Some commands generate 2 ACK, 1 for the command, and 1 for reciving data. |
|||
====Mouse Command Set==== |
====Mouse Command Set==== |
||
{| border="1" cellspacing="0" cellpadding="5" align="center" |
{| border="1" cellspacing="0" cellpadding="5" align="center" |
||
! Hex value |
! Hex value |
||
! Meaning |
! Meaning |
||
! Description |
|||
! Describing |
|||
|- |
|- |
||
! 0xFF |
! 0xFF |