I am looking for a way to capture and then parse raw mouse data. Before it goes through the driver and things of that nature.

You sound unhappy with your current mouse driver, because you're talking about capturing 'raw mouse data', and parsing it yourself: that is, you want to do the mouse driver's job for it. You haven't explained why you're unhappy with your mouse driver in the first place, though. Are you sure you really need to write your own? What is it that your existing mouse driver won't do?

I don't know a lot about writing device drivers, but they're often considered rather difficult to write. Sometimes this is just because of a lack of detailed documentation on how the device hardware interfaces with the computer hardware. Sometimes it's because there's a lot of complexity in the interface. That said, mice are relatively simple, and have been around for a long time, so it might not be so hard in this case. Still, it's probably not worth it unless you have to.

In any case, Perl is probably the wrong language for coding your driver code: if I really needed to write one, I'd write it mostly in C, and then use the Perl XS mechanism to call it from Perl. You can read more about perlxs in the perlxs and perlxstut sections of the man page.

Beyond that, you could try reading up on how in general mice work (e.g. general protocols), how your mouse in specific works (e.g. implementation details for those protocols), how mice work under XP (how those protocols are interpreted by XP), and how they all interact together. If this all sounds like a lot of complexity to deal with just to talk to a silly little mouse, well, that's exactly why device drivers were created: to hide that complexity behind a standard interface.

Good luck! Sorry I couldn't be more helpful: perhaps if you post the exact problem you're trying to solve we could give a better answer.
--
Ytrew


In reply to Re: Capturing Raw Mouse Data by Ytrew
in thread Capturing Raw Mouse Data by bkiahg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.