Mouse Input: Difference between revisions

m
fixed typo
[unchecked revision][unchecked revision]
m (→‎Mouse Packet Info: Replaced childish M$ with MS)
m (fixed typo)
 
(11 intermediate revisions by 7 users not shown)
Line 4:
 
===USB Mouse===
A USB mouse generally emulates a PS2 mouse, except that it generates IRQs from the USB bus, and not IRQ 12. Good idea is to also select the checkbox "enable mouse capture". "Mouse toggle method" enables you to choose from a list hotkey to switch between mouse capture enabled or disabled.
 
===Bochs===
If you use bochs, and want your mouse to emulate PS2 mouse, you need to edit keyboard & mouse settings and set mouse type to either "ps2" (this is the mouse without mouse wheel button) or "imps2" (this is the mouse with mouse wheel button).
 
===PS2 Mouse -- Basic Operation (Microsoft compliant)===
Line 18 ⟶ 21:
which is which. To tell if there is any available data on port 0x60 at all, it is necessary
to read a byte from port 0x64. In that byte from port 0x64, bit number 0 (value=1) indicates that a byte is
available to be read on port 0x60. An additional bit, bit number 5 (value=0x20 or 0b00100000), indicates that this next byte
came from the mouse, if the bit is set. If you look at [[RBIL]], it says that this "mouse bit" is MCA specific,
but this is no longer true. All PCs that support PS2 mice use this bit to indicate that the incoming byte was
Line 89 ⟶ 92:
=====Formats of Optional 4th Packet Byte=====
If the mouse has been initalized so that its mouseID is 3 or 4, it will send a 4th byte in each packet. On all current
mice, the top two bits should be ignored. On some mice, the bits will flip between 0 and 1, based on scroll wheeelwheel
movement. If the mouse has a 4th and 5th mouse button, then their state is indicated by bit 4 (value=0x10), and bit
5 (value=0x20), respectively. Note: if the buttons <i>do not</i> exist, then these bits may flip based on scroll
Line 179 ⟶ 182:
====Useful Mouse Command Set====
*Note: remember that the mouse responds to all command bytes and data bytes with an ACK (0xFA).
*Note2: the commands given in the table are sent to port 0x60. If a command needs additional byte (like sampling rate), this byte goes to port 0x60 too.
 
{| border="1" cellspacing="0" cellpadding="5" align="center"
Line 275 ⟶ 279:
Byte 2:
{| border="1" cellspacing="0" cellpadding="5" align="center"
!resolution
!resoltion
|}
Byte 3:
Line 378 ⟶ 382:
 
====PS/2 Device Unplugging/Hot Plugging====
SomeThe idiotperson who created the PS/2 device specs did not specify that PS/2 devices can be unplugged and replugged
while the computer remains turned on ("hot plugging"). A long time ago, some other idiotspeople actually designed motherboards that would
be slightly damaged if PS2 hot plugging occurs. However, mice and keyboards have cords that were made to be tripped over,
and sometimes it is very logical to try moving a mouse from one machine to another, temporarily, without powering
Line 459 ⟶ 463:
===PC Serial Mouse===
 
For info on running a serial mouse on an RS232 port, see [http://freedos-32.sourceforge.net/showdoc.php?page=sermouse this document from the freedos documentation].
 
==Mac Mouse Interface==
 
{{Stub}}
(stub - to be written later)
 
 
==See Also==
===Threads===
* [http[topic://www.osdev.org/phpBB2/viewtopic.php?t=10247 |SANiK's mouse code]]
* [http[topic://www.osdev.org/phpBB2/viewtopic.php?t=24277 |Mouse driver code in assembly]]
* [http[topic://www.osdev.org/phpBB2/viewtopic.php?t=8323 |PS2 mouse IRQ]]
* [http[topic://www.osdev.org/phpBB2/viewtopic.php?t=6942 |PS2 mouse links]]
 
===External Links===
* [http://os-development.000webhostapp.com/mys.html Tutorial on page os-development]
* [httphttps://www.computer-engineeringavrfreaks.orgnet/sites/default/files/PS2%20Keyboard.pdf Adam Chapweske on PS/2 Mouse and Keyboard protocols]
* [http://www.win.tue.nl/~aeb/linux/kbd/scancodes-13.html Linux PS2 mouse article with non-Microsoft mouse info]
* [http://houbysoft.com/download/ps2mouse.html Tutorial with sample C code]
* [http://www.mcamafia.de/pdf/ibm_hitrc07.pdf IBM's Keyboard and Auxiliary Device (mouse) Controller documentation]
 
[[Category:Human Interface Device]]
[[de:PS/2-Maus]]
Anonymous user