Shop OBEX P1 Docs P2 Docs Learn Events
Mouse Recorder — Parallax Forums

Mouse Recorder

PhilldapillPhilldapill Posts: 1,283
edited 2008-08-15 13:52 in Propeller 1
There's an online game I like to dabble in a little bit; Eve. In some of it, there is some fairly repetative stuff that involves a simple mouse action once in a while. I have a USB mouse, but it works with a PS/2 adapter.

I've brought something similiar up before, but would like to really delve into it now. I want to make a device, with the propeller of course, that would allow the user to push a button and "record" the data sent to it by a mouse. The user would do his thing - moving the mouse X units, clicking, moving X more units, clicking and so on. Then, he would stop recording, and tell the device to replay all those actions in a loop. This replay would be sent to the computer's normal port and imitate a real mouse.

In the game, I would set the mouse up to do these actions, then let it go and go and go, over and over. Since this is a hardware device and looks just like a real moust to the computer, the game wouldn't know any different.

Would all this be possible? I would think it is just a matter of reading the data coming in from the mouse, and spitting it back out to the computer. Is there any two way communication going on between computer and mouse? I have very little knowledge of these communication protocals so forgive my ignorance.· Thanks guys!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-12 21:02
    The mouse to Propeller piece should be easy, particularly with the already existing mouse driver. For the Propeller to PC mouse emulator, you'll have to do your own programming. There are all sorts of articles on the mouse PS/2 protocol. Start with the Wikipedia and follow their links to detailed descriptions of what a PS/2 mouse should look like.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-08-13 01:07
    I KNOW what you are doing!

    No fair using a Propeller to drive the mouse on Treeloot! [noparse]:)[/noparse]

    (I'm kidding.. I don't think Treeloot.com is even online anymore. It had cash prizes hidden under
    a couple of pixel points, but you had to click on thousands to find them.)

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • SRLMSRLM Posts: 5,045
    edited 2008-08-13 01:36
    The mouse that I use has two special buttons on the side, and comes with software that allows you to choose what those do. If your mouse is like that then you could have the software set to "do nothing", and use the buttons to comunicate with the Propeller. Suggested: one to start/stop recording a sequence, one to play the sequence.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-08-13 03:07
    LOL, no OBC I'm not doing that, BUT the thought did cross my mind a few years ago before I knew anything about how to do it... That's probably WHY treeloot isn't around anymore!

    This is something similiar - kind of a cheat, but not really. Just a little idea I had and told my player buddies about. I asked if they'd be willing to put down $20 for one of these gadgets and they were all over it. If I can get it to work, who knows... maybe word will spread and everyone will want one. [noparse]:)[/noparse]

    As for the programming side, I kind of figured the mouse output would be pretty difficult since the input is already made but nothing as far as outputing the signals. I'll do some reading on it.
  • jazzedjazzed Posts: 11,803
    edited 2008-08-13 03:14
    There are Macro programs that do this ... no guarantees about them not key-logging your passwords though. It is a nice project·idea.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-08-13 03:19
    Yep, one reason I don't want to use someone else's logging program... Plus, it's hard to market software [noparse];)[/noparse]
  • SRLMSRLM Posts: 5,045
    edited 2008-08-13 04:20
    Shouldn't be too difficult to market something that does mouse logging, unless you like to use it to type your passwords. Personally, I think the only useful data that such a hacker could get is when the computer is used.
  • jazzedjazzed Posts: 11,803
    edited 2008-08-13 04:49
    Hmm. Maybe a specific mouse movement could be used as a digital signature. Javascript for example is quite good at reading mouse position. The only way to play back a movement exactly would be by using a recorded progression. Many problems to consider ....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • BradCBradC Posts: 2,601
    edited 2008-08-13 05:54
    Your biggest problem is going to be the relative nature of mouse input. Unless you get the loop to start and stop in precisely the same mouse positions it will slowly shift each time through the loop. There is a way around this if the machine is running windows, but it's as complex as hell and involves a USB mouse with HID tables tweaked to perform absolute input rather than relative;

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • SRLMSRLM Posts: 5,045
    edited 2008-08-13 07:21
    The shift in mouse position is easy to overcome. Just coose a corner of the screen and shove the mouse into that corner. You'll notice that the mouse cannot move any further in two dimensions, x and y. Thats all you need. Just make sure to record, start your macros from that corner and you can prevent mouse drift.
  • evanhevanh Posts: 15,438
    edited 2008-08-14 10:54
    You could actually simulate a tablet instead. They are absolute. Guess you'd need a tablet driver for Windoze as well.

    Of course, such a device is still against Eve's EULA. Even if it isn't detectable. :P Macroing is considered a serious ingame offense simply because it typically allows generation of new ISK while afk. Potentially distorting the economy.

    There is one form of macro I'd be in favor of though, an automatic skill training changer. The intentional lack of a decent skill queue is pretty sucky for that game. It's the second reason why I stopped playing Eve. The primary reason being the shockingly bad framerate stutter, there is no excuse for how bad that gets.


    Evan
  • BradCBradC Posts: 2,601
    edited 2008-08-14 11:46
    The Windows HID Stack copes with absolute inputs, so you can emulate a tablet with a modified USB mouse. It's how we got mouse movement in a VNC window to work properly in QEMU.
    You don't need any additional drivers for any version of windows from 98SE up..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • evanhevanh Posts: 15,438
    edited 2008-08-15 13:52
    BradC said...
    You don't need any additional drivers for any version of windows from 98SE up..
    So the mouse can send either absolute or relative on the fly? Or does it need to negotiate which mode of operation first?
Sign In or Register to comment.