LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-29-2011, 11:09 AM   #1
Movax
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Rep: Reputation: Disabled
Read data from /dev/mouse


I'm simply (at this point) trying to read data form the mouse to verify is is working as specified by the standard protocol here: http://www.computer-engineering.org/ps2mouse/

I have a simple script to test:

Code:
while true
do
head -c 1 /dev/mouse|printf "%X\n"
done
But all I get are zeros (0). This can't be right, a simple cat /dev/mouse gives me tons of garbage. How can I dump the bytes being read in to the screen? Even better, is there a quick way to print the byte in base 2?

Thanks
 
Old 09-29-2011, 11:46 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Possibly. Check the od(1) manpages - might meet your needs.
 
Old 09-29-2011, 12:05 PM   #3
Movax
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
This is on a very stripped down (embedded) install, I am trying not to add any more binaries to the initrd, but I'll give it a shot.
 
Old 09-29-2011, 01:05 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
dd if=/dev/mouse of=somewhere should get the lot in decimal or hex.

It's a bit late in the day for binary, I'm afraid; I'm overworking my brain a bit
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read System Call is getting blocked when tried to read the data from CDC device sanju.lnt Linux - Embedded & Single-board computer 0 09-11-2011 11:48 PM
Simulate mounting ISO to /dev/cdrom (populate /dev/scd0 with data) bogdan_rec Linux - Software 2 06-30-2009 04:32 AM
USB mouse x, y data read borganve Linux - Hardware 1 03-17-2008 07:34 AM
Can I go from /dev/sda to /dev/rd w/o data loss? RPaulW Linux - Hardware 1 10-10-2005 10:39 AM
xwindows trouble -no /dev/mouse /dev/input/mice fatblueduck Linux - General 2 06-05-2005 11:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration