D2k Sardaukar Posted January 13, 2010 Share Posted January 13, 2010 Since you guys are so good at hacking Dune2000 and Dune2 I wonder if you guys also know how to do this - or at least point me to where I could start looking.I got an optical Microsoft USB mouse and I want to use it for getting data from an ATtiny(13) microcontroller to the PC. I would like to get the click signals (ON/OFF) from the mouse and read that on the pc. This way I can open the mouse and send 010101 and stuff from the microcontroller to the PC. I was thinking about stuff like temperature or speed from something.Any idea's how to hack the mouse driver and get the clicking of the mouse, for example, in an .txt file without it really clicking in windows (or perhaps that is not that bad if it happens). edit: Is that called a hook?Thanks for reading. :) Quote Link to comment Share on other sites More sharing options...
Rene Posted January 13, 2010 Share Posted January 13, 2010 I think it will be easier to make the micro controller send the data to a COM port of your pc, and read that. That is, if you have a com port. Otherwise you would need to get a converter. I've never written USB code myself (I did some hardware communication on a COM port some time ago, I couldn't find a Java USB API), but I believe it is harder to code than when using a com port. Quote Link to comment Share on other sites More sharing options...
D2k Sardaukar Posted January 13, 2010 Author Share Posted January 13, 2010 I could of course also just record the clicks with javascript, but I cannot do it that fast and perhaps timing can be a problem.edit: left mouse button a 1 and right mouse button a 0, that could work. no timings needed. :) Quote Link to comment Share on other sites More sharing options...
Kiyouta Posted January 13, 2010 Share Posted January 13, 2010 You can record all the events a mouse triggers (move, button click, wheel action) by hooking Windows messages. I don't think you need to drill down as deep as the mouse driver to capture such data. If you know C++, I'm sure there's something on MSDN about it...http://msdn.microsoft.com/en-us/library/ms644959(VS.85).aspxThe WM_MOUSE messages would contain all the info you need I think. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.