Files
USB4VC/resources/Mouse protocol - Everything2.com.htm
2021-11-29 19:35:45 +00:00

217 lines
21 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Mouse protocol - Everything2.com</title>
<link rel="stylesheet" id="basesheet" type="text/css" href="Mouse%20protocol%20-%20Everything2.com_files/1973976.css" media="all"><link rel="stylesheet" id="zensheet" type="text/css" href="Mouse%20protocol%20-%20Everything2.com_files/1882070.css" media="screen,tv,projection"><link rel="stylesheet" id="printsheet" type="text/css" href="Mouse%20protocol%20-%20Everything2.com_files/2004473.css" media="print"><!-- base href="https://everything2.com/" --><link rel="canonical" href="https://everything2.com/title/Mouse+protocol"><meta name="description" content="PC Mice come in various flavours : the BUS mouse, the standard PS/2 mouse, the serial port|serial mouse, and the USB mouse. I do not know if there are F..."><link rel="icon" href="https://everything2.com/favicon.ico" type="image/vnd.microsoft.icon">
<!--[if lt IE 8]><link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"><![endif]--><link rel="alternate" type="application/atom+xml" title="Everything2 New Writeups" href="https://everything2.com/node/ticker/New+Writeups+Atom+Feed"><link href="Mouse%20protocol%20-%20Everything2.com_files/font-awesome.css" rel="stylesheet">
</head><body class="writeuppage e2node" itemscope="" itemtype="http://schema.org/WebPage"><div class="headerads">
<center>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-0613380022572506";
/* E2 top banner */
google_ad_slot = "9636638260";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript" src="Mouse%20protocol%20-%20Everything2.com_files/show_ads.js"></script>
</center></div><div id="header"><div id="searchform"><form method="get" action="/index.pl" enctype="multipart/form-data" id="search_form" role="form"><div class="form-group"><div class="has-feedback has-feedback-left"><input type="text" name="node" size="28" maxlength="230" class="form-control" id="node_search" placeholder="Search"><i class="glyphicon glyphicon-search form-control-feedback"></i></div><input type="hidden" name="lastnode_id" value="1413990"><input type="submit" name="searchy" value="search" id="search_submit" title="Search within Everything2" class="btn btn-default"><span id="searchbtngroup">
<span title="Include near matches in the search results"><label><input type="checkbox" name="soundex" value="1" id="near_match">Near Matches</label></span>
<span title="Show all results, even when there is a page matching the search exactly"><label><input type="checkbox" name="match_all" value="1" id="match_all">Ignore Exact</label></span></span>
</div></form></div><div id="e2logo"><a href="https://everything2.com/">Everything<span id="e2logo2">2</span></a></div></div><div id="wrapper"><div id="mainbody" itemprop="mainContentOfPage"><!-- google_ad_section_start --><div id="pageheader">
<h1 class="nodetitle">Mouse protocol</h1>
</div>
<form method="post" action="/title/Mouse+protocol" enctype="multipart/form-data" id="pagebody" name="pagebody"><input type="hidden" name="node_id" value="1413990"><div class=" item"><div class="contentinfo contentheader"><table width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr class="wu_header"><td class="wu_type"><span class="type">(<a href="https://everything2.com/user/Gruime/writeups/Mouse+protocol">idea</a>)</span></td>
<td style="text-align:left" class="wu_author">by <a name="Gruime"></a><strong><a href="https://everything2.com/user/Gruime" class="author">Gruime</a></strong> </td>
<td style="text-align:right" class="wu_dtcreate"><small class="date" title="Jan 12 2003 at 0:28:32">Sun Jan 12 2003 at 0:28:32</small></td>
</tr></tbody></table>
</div>
<div class="content">
PC Mice come in various flavours :
the <b><a href="https://everything2.com/title/BUS" title="BUS" class="populated">BUS</a></b> mouse,
the standard <b><a href="https://everything2.com/title/PS%252F2" title="PS/2" class="populated">PS/2</a></b> mouse,
the <b><a href="https://everything2.com/title/serial+port" title="serial port" class="populated">serial</a></b> mouse,
and the <b><a href="https://everything2.com/title/USB" title="USB" class="populated">USB</a></b> mouse.
I do not know if there are <a href="https://everything2.com/title/FireWire" title="FireWire" class="populated">FireWire</a> mice available but it isn't technologically impossible.
<p>
</p><ul><li>BUS mice are the oldest. They are also called <a href="https://everything2.com/title/ISA" title="ISA" class="populated">ISA</a> mice because they are usually connected to the
PC using an ISA card. Everything is handled by the ISA card and the mouse soely consists of
the detectors and buttons.
</li><li>
PS/2 mice are the best because nearly every recent computer is equipped with a PS/2 port
and the logic is hard coded on the <a href="https://everything2.com/title/motherboard" title="motherboard" class="populated">motherboard</a>. As a consequence, the CPU is not used to
decode packet data sent by the mouse which saves a few <a href="https://everything2.com/title/cpu+cycles" title="cpu cycles" class="populated">cycles</a>.
</li><li>
Serial mice do not use the CPU for data transmission either but they take up a <a href="https://everything2.com/title/serial+port" title="serial port" class="populated">serial port</a>, which
can be very annoying on single-serial-port computers.
</li><li>
The USB mice is probably the easiest to use, but data is transmitted via the USB bus and
therefore decoded by the CPU. But today's computers are so powerful that it makes no
difference for the user. Nevertheless I can't bear seeing an USB mouse on a PS/2 compliant
machine because I think of all the CPU cycles that are lost for nothing.
<h5>Thanks to Xenex for pointing out the "silky smoothness" of USB mice. This is because their <a href="https://everything2.com/title/mouse" title="mouse" class="populated">refresh rate</a> is higher by default. The <a href="https://everything2.com/title/mouse" title="mouse" class="populated">refresh rate</a> of PS/2 mice can be changed up to 200 <a href="https://everything2.com/title/Hz" title="Hz" class="populated">Hz</a> by sending the appropriate message to the mouse controller. (<a href="https://everything2.com/title/ps2rate" title="ps2rate" class="populated">ps2rate</a> does this under Windows) This is mainly used by <a href="https://everything2.com/title/quakers" title="quakers" class="populated">quakers</a> who tune their system to get the higher <a href="https://everything2.com/title/FPS" title="FPS" class="populated">FPS</a> possible. Therefore they need the softest mouse movement possible to <a href="https://everything2.com/title/frag" title="frag" class="populated">frag</a> their ennemies.</h5>
</li></ul>
<h1>The serial mouse</h1>
This type of mouse is connected directly to the <a href="https://everything2.com/title/serial+port" title="serial port" class="populated">serial port</a> and uses the standard <a href="https://everything2.com/title/RS-232" title="RS-232" class="populated">RS-232C</a>
protocol. The mouse gets its current from the RS-232 DRT and RTS pins and uses less than 15 mA.
<h4>Pinout</h4>
<pre> Pin | Name | Mouse Usage
-------+--------------------+--------------------------------------------------
shell | Protective Ground |
3 | TD | Serial data from host to mouse (only for power)
2 | RD | Serial data from mouse to host
7 | RTS | Positive voltage to mouse
8 | CTS |
6 | DSR |
5 | Signal Ground |
4 | DTR | Positive voltage to mouse and reset/detection
</pre>
<h4>Packet detail</h4>
When the mouse state changes, it sends a packet consisting of 3 (Microsoft mouse flavour)
or 5 (Logitech/mouse systems corp. mouse flavour) to the computer.
Each packet contains the buttons pressed and the relative position since the last packet.
<pre><b>Microsoft mouse flavour</b>
<b> Bit 7 6 5 4 3 2 1 0</b>
x 1 L R Y7 Y6 X7 X6 Byte 0
x 0 X5 X4 X3 X2 X1 X0 Byte 1
x 0 Y5 Y4 Y3 Y2 Y1 Y0 Byte 2
</pre>
L = Left Button (1 when pressed)<br>
R = Right Button (1 when pressed)<br>
X0..X7 = X distance 8-bit <a href="https://everything2.com/title/twos+complement" title="twos complement" class="populated">two's complement</a> value -128 to +127<br>
Y0..Y7 = Y distance 8-bit <a href="https://everything2.com/title/twos+complement" title="twos complement" class="populated">two's complement</a> value -128 to +127<br>
<pre><b>Logitech/mouse systems corp. mouse flavour</b>
<b> Bit 7 6 5 4 3 2 1 0</b>
1 0 0 0 0 L M R Byte 0
X7 X6 X5 X4 X3 X2 X1 X0 Byte 1
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 Byte 2
X7 X6 X5 X4 X3 X2 X1 X0 Byte 3
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 Byte 4
</pre>
L = Left Button (1 when pressed)<br>
M = Middle Button (1 when pressed)<br>
R = Right Button (1 when pressed)<br>
X0..X7 = X distance 8-bit <a href="https://everything2.com/title/twos+complement" title="twos complement" class="populated">two's complement</a> value -127 to +127<br>
Y0..Y7 = Y distance 8-bit <a href="https://everything2.com/title/twos+complement" title="twos complement" class="populated">two's complement</a> value -127 to +127<br>
<p>
As you can see, a serial mouse driver is really easy to implement.
</p><h5>
http://www.hut.fi/~then/mytexts/mouse.html
</h5>
</div>
<div class="contentinfo contentfooter"><div id="categories1413991"></div>
<table width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr class="wu_footer"><td class="wu_social"><div class="social_button social_twitter"><a href="http://twitter.com/home?status=Mouse%20protocol%20-%20http://everything2.com/s/xGtc" title="Twitter" target="_new" onclick="window.location='/node/1413990?bookmark_site=twitter&amp;op=socialBookmark'"></a></div>
<div class="social_button social_facebook"><a href="http://www.facebook.com/share.php?u=http://everything2.com/user/Gruime/writeups/Mouse+protocol&amp;t=Mouse%20protocol" title="Facebook" target="_new" onclick="window.location='/node/1413990?bookmark_site=facebook&amp;op=socialBookmark'"></a></div>
<div class="social_button social_delicious"><a href="http://del.icio.us/post?url=http://everything2.com/user/Gruime/writeups/Mouse+protocol&amp;title=Mouse%20protocol" title="del.icio.us" target="_new" onclick="window.location='/node/1413990?op=socialBookmark&amp;bookmark_site=delicious'"></a></div>
<div class="social_button social_digg"><a href="http://digg.com/submit?url=http%3A%2F%2Feverything2.com%2Fuser%2FGruime%2Fwriteups%2FMouse%2520protocol&amp;phase=2&amp;title=Mouse%20protocol" title="Digg" target="_new" onclick="window.location='/node/1413990?op=socialBookmark&amp;bookmark_site=digg'"></a></div>
<div class="social_button social_stumbleupon"><a href="http://www.stumbleupon.com/submit?title=Mouse%20protocol&amp;url=http%3A%2F%2Feverything2.com%2Fuser%2FGruime%2Fwriteups%2FMouse%2520protocol" title="StumbleUpon" target="_new" onclick="window.location='/node/1413990?op=socialBookmark&amp;bookmark_site=stumbleupon'"></a></div>
<div class="social_button social_reddit"><a href="http://www.reddit.com/submit?title=Mouse%20protocol&amp;url=http://everything2.com/user/Gruime/writeups/Mouse+protocol" title="Reddit" target="_new" onclick="window.location='/node/1413990?op=socialBookmark&amp;bookmark_site=reddit'"></a></div>
</td>
<td class="wu_vote"><a href="https://everything2.com/title/Mouse+protocol?confirmop=ilikeit&amp;like_id=1413991" id="like1413991" class="action ajax like1413991:ilikeit:1413991:" title="send a message to the author telling them someone likes their work">I like it!</a></td>
<td class="wu_cfull"></td>
</tr></tbody></table>
</div></div><div id="displaytypelinks"></div></form><div id="softlinks">
<table width="100%" cellspacing="0" cellpadding="10" border="0">
<tbody><tr>
<td class="sw8" bgcolor="#ffffff"><a href="https://everything2.com/title/ps2rate">ps2rate</a></td>
<td class="sw5" bgcolor="#f7f7f7"><a href="https://everything2.com/title/PS%252F2">PS/2</a></td>
<td class="sw4" bgcolor="#f0f0f0"><a href="https://everything2.com/title/serial+port">serial port</a></td>
<td class="sw4" bgcolor="#e9e9e9"><a href="https://everything2.com/title/mouse">mouse</a></td></tr>
<tr>
<td class="sw3" bgcolor="#e2e2e2"><a href="https://everything2.com/title/Ten+ways+to+free+yourself+from+the+tyranny+of+your+mouse">Ten ways to free yourself from the tyranny of your mouse</a></td>
<td class="sw3" bgcolor="#dbdbdb"><a href="https://everything2.com/title/FireWire">FireWire</a></td>
<td class="sw2 nodeshell" bgcolor="#d4d4d4"><a href="https://everything2.com/title/Windows+source+code">Windows source code</a></td>
<td class="sw2" bgcolor="#cdcdcd"><a href="https://everything2.com/title/Mrs.+Frisby+and+the+Rats+of+NIMH">Mrs. Frisby and the Rats of NIMH</a></td></tr>
<tr>
<td class="sw1" bgcolor="#c6c6c6"><a href="https://everything2.com/title/twos+complement">twos complement</a></td>
<td class="sw1" bgcolor="#bfbfbf"><a href="https://everything2.com/title/PIC16F84">PIC16F84</a></td>
<td class="sw1" bgcolor="#b8b8b8"><a href="https://everything2.com/title/motherboard">motherboard</a></td>
<td class="sw1" bgcolor="#b1b1b1"><a href="https://everything2.com/title/bus">bus</a></td>
</tr>
</tbody></table>
</div><div class="nodelock"><p><a href="https://everything2.com/node/superdoc/login" title="login" class="populated">Log in</a> or <a href="https://everything2.com/node/superdoc/Sign+Up" title="Sign Up" class="populated">register</a> to write something here or to contact authors.</p></div><!-- google_ad_section_end --></div><div id="sidebar"><div class="nodelet" id="signin"><h2 class="nodelet_title">Sign in</h2><div class="nodelet_content"><form method="post" action="/index.pl" enctype="multipart/form-data" id="loginform" name="loginform"><input type="hidden" name="node_id" value="1413990">
<input type="hidden" name="op" value="login">
<table border="0">
<tbody><tr>
<td><strong>Login</strong></td>
<td><input type="text" name="user" tabindex="1" size="10" maxlength="20"></td>
</tr>
<tr>
<td><strong>Password</strong></td>
<td><input type="password" name="passwd" tabindex="2" size="10" maxlength="240"> </td>
</tr>
</tbody></table>
<font size="2"><label><input type="checkbox" name="expires" value="+10y" tabindex="3">remember me</label></font><input type="submit" tabindex="4" name="login" value="Login"><br><a href="https://everything2.com/node/superdoc/Reset+password" title="Reset password" class="populated">Lost password</a>
<p><strong><a href="https://everything2.com/node/superdoc/Sign+up">Sign up</a></strong></p>
<div><input type="hidden" name=".cgifields" value="expires"></div>
</form><p>Need help? <a href="mailto:accounthelp@everything2.com">accounthelp@everything2.com</a></p></div></div><div class="nodelet" id="recommendedreading"><h2 class="nodelet_title">Recommended Reading</h2><div class="nodelet_content"><h4><a href="https://everything2.com/title/An+Introduction+to+Everything2">About Everything2</a></h4><h4><a href="https://everything2.com/node/superdoc/Cool+Archive">User Picks</a></h4><ul class="infolist"><li><a href="https://everything2.com/user/etouffee/writeups/face+the+silence">face the silence</a></li><li><a href="https://everything2.com/user/Tem42/writeups/Currywurst">Currywurst</a></li><li><a href="https://everything2.com/user/ebbixx/writeups/Garum">Garum</a></li><li><a href="https://everything2.com/user/Glowing+Fish/writeups/Wild%253A+From+Lost+to+Found+on+the+Pacific+Crest+Trail">Wild: From Lost to Found on the Pacific Crest Trail</a></li><li><a href="https://everything2.com/user/Tem42/writeups/Captain+Underpants">Captain Underpants</a></li><li><a href="https://everything2.com/user/Estelore/writeups/Otoizm">Otoizm</a></li></ul><h4><a href="https://everything2.com/node/superdoc/Page+of+Cool">Editor Picks</a></h4><ul class="infolist"><li><a href="https://everything2.com/title/Jenin">Jenin</a></li><li><a href="https://everything2.com/title/Damien+Hirst">Damien Hirst</a></li><li><a href="https://everything2.com/title/Democracy+in+America">Democracy in America</a></li><li><a href="https://everything2.com/title/Desine+fata+deum+flecti+sperare+precando">Desine fata deum flecti sperare precando</a></li><li><a href="https://everything2.com/title/Miles+Davis">Miles Davis</a></li><li><a href="https://everything2.com/title/Thomas+the+Rhymer">Thomas the Rhymer</a></li></ul></div></div><div class="nodelet" id="newwriteups"><h2 class="nodelet_title">New Writeups</h2><div class="nodelet_content"><ul class="infolist"><li class="contentinfo"><a href="https://everything2.com/title/Set+square?author_id=7392#Tem42" class="title">Set square</a>
<span class="type">(<a href="https://everything2.com/user/Tem42/writeups/Set+square">thing</a>)</span>
<cite>by <a href="https://everything2.com/user/Tem42" class="author">Tem42</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/T+square?author_id=7392#Tem42" class="title">T square</a>
<span class="type">(<a href="https://everything2.com/user/Tem42/writeups/T+square">thing</a>)</span>
<cite>by <a href="https://everything2.com/user/Tem42" class="author">Tem42</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/odd+job?author_id=7392#Tem42" class="title">odd job</a>
<span class="type">(<a href="https://everything2.com/user/Tem42/writeups/odd+job">thing</a>)</span>
<cite>by <a href="https://everything2.com/user/Tem42" class="author">Tem42</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/Currywurst?author_id=7392#Tem42" class="title">Currywurst</a>
<span class="type">(<a href="https://everything2.com/user/Tem42/writeups/Currywurst">thing</a>)</span>
<cite>by <a href="https://everything2.com/user/Tem42" class="author">Tem42</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/Asafetida?author_id=7392#Tem42" class="title">Asafetida</a>
<span class="type">(<a href="https://everything2.com/user/Tem42/writeups/Asafetida">thing</a>)</span>
<cite>by <a href="https://everything2.com/user/Tem42" class="author">Tem42</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/interval+recognition+mnemonics?author_id=2015817#Estelore" class="title">interval recognition mnemonics</a>
<span class="type">(<a href="https://everything2.com/user/Estelore/writeups/interval+recognition+mnemonics">idea</a>)</span>
<cite>by <a href="https://everything2.com/user/Estelore" class="author">Estelore</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/Fat+alley+cats+eat+garbage?author_id=2015817#Estelore" class="title">Fat alley cats eat garbage</a>
<span class="type">(<a href="https://everything2.com/user/Estelore/writeups/Fat+alley+cats+eat+garbage">idea</a>)</span>
<cite>by <a href="https://everything2.com/user/Estelore" class="author">Estelore</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/Farmers+can+grow+dates+and+even+bananas?author_id=2015817#Estelore" class="title">Farmers can grow dates and even bananas</a>
<span class="type">(<a href="https://everything2.com/user/Estelore/writeups/Farmers+can+grow+dates+and+even+bananas">idea</a>)</span>
<cite>by <a href="https://everything2.com/user/Estelore" class="author">Estelore</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/Mothula?author_id=977360#Glowing%20Fish" class="title">Mothula</a>
<span class="type">(<a href="https://everything2.com/user/Glowing+Fish/writeups/Mothula">thing</a>)</span>
<cite>by <a href="https://everything2.com/user/Glowing+Fish" class="author">Glowing Fish</a></cite>
</li><li class="contentinfo"><a href="https://everything2.com/title/A+Born+Loser?author_id=977360#Glowing%20Fish" class="title">A Born Loser</a>
<span class="type">(<a href="https://everything2.com/user/Glowing+Fish/writeups/A+Born+Loser">review</a>)</span>
<cite>by <a href="https://everything2.com/user/Glowing+Fish" class="author">Glowing Fish</a></cite>
</li></ul><div class="nodeletfoot morelink">(<a href="https://everything2.com/node/superdoc/Writeups+by+Type">more</a>)</div></div></div></div><!-- end sidebar --></div><div id="footer"> Everything2 ™ is brought to you by Everything2 Media, LLC. All content copyright © original author unless stated otherwise.</div>
<script type="text/javascript" name="nodeinfojson" id="nodeinfojson">
e2 = {"lastnode_id":"1413990","node_id":"1413990","collapsedNodelets":"signin!","guest":1,"title":"Mouse protocol"};
</script>
<script src="Mouse%20protocol%20-%20Everything2.com_files/jquery-1.js" type="text/javascript"></script><script src="Mouse%20protocol%20-%20Everything2.com_files/1874924.js" type="text/javascript"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-1314738-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script></body></html>