Shop OBEX P1 Docs P2 Docs Learn Events
Mouse Output controller? — Parallax Forums

Mouse Output controller?

PhilldapillPhilldapill Posts: 1,283
edited 2008-07-27 11:05 in Propeller 1
I know there is a mouse input object in the obex, and it's great. I'm not familiar with how it all works, but is it possible(and fairly simple) to mimic a mouse using the propeller? I think it would be great to be able to "record" some mouse movements with the prop, then replay them without any program involved on the PC. Can this be done or is there some HID issues or something?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-22 20:17
    It's possible, but not simple, for a Propeller to "pretend" to be a PS/2 mouse. I don't think it's been done yet. You'll have to do your own research. There have been some forum threads about emulating a PS/2 keyboard and emulating a PS/2 mouse is similar although the format of the data is different. Start with the Wikipedia for more information.

    It's possible, but very much not simple for a Propeller to "pretend" to be a USB mouse. You basically have to emulate a "HID" (human interface device). Again, I don't think anyone has done it yet although I remember some forum messages about wanting to emulate a USB keyboard. I don't know how far anyone has gotten.

    I know there have been some projects to use the Propeller as a USB host for HID devices (like a PC), but that's not the same. It's the opposite end of the connection.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-07-22 22:06
    Thanks Mike. That's kind of along the lines of what I had imagined. I was pretty sure the USB path was a little too complicated, so I was hoping to emulate a PS/2 mouse. The reason I'd like to do this is for a manual computer task that involves doing repeatative mouse clicking on screen. I was hoping to be able to "record" these repetative mouse clicks and motions, so that I could set the propeller to just repeat them over and over.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-07-22 23:36
    Bet the prop could emulate a serial mouse easily enough..

    local.wasp.uwa.edu.au/~pbourke/dataformats/serialmouse/

    OBC

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

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    Need a part? Got spare electronics? - The Electronics Exchange
  • BradCBradC Posts: 2,601
    edited 2008-07-23 16:43
    I reckon emulating a serial mouse would be easy.

    It would not be difficult at all to modify the "California dreamin" USB thingo (which emulates a keyboard) to emulate a mouse. All you need to do is change the way the report is sent and modify the class and report descriptors. It's actually very easy if you are familiar with USB HID descriptors.

    If nobody gets to it in the next week or two I'll do it when I get back from the UK (Off there tomorrow for a week in the Cold.. YAY!).

    I've been meaning to get around to it but real life keeps getting in the way

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • TimmooreTimmoore Posts: 1,031
    edited 2008-07-23 17:46
    Take a look at these
    1. A PS2 keycounter, it uses a AVR but it doesn't look too difficult to duplicate using a prop. The low level signaling is the same for a PS2 mouse.
    http://www.sparkfun.com/commerce/product_info.php?products_id=8652
    2. Description of a usb/ps2 mouse using cypress chips, gives all the protocol etc details to be a ps2 mouse.
    http://download.cypress.com.edgesuite.net/design_resources/application_notes/contents/designing_a_usb_keyboard_and_ps_2_r__mouse_combination_device_using_the_cypress_cy7c63413_12.pdf
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-07-27 11:05
    Hello Phil,

    if you want to put mouseclicks and moves into a PC try

    www.autohotkey.com

    It has a very powerful scriptlanguage even for very complex mousemove- and click-operations
    including waiting for new windows to appear on the screen, windowrelative mouse-x-y-coordinates and much much more

    best regards

    Stefan
Sign In or Register to comment.