Professional Web Applications Themes

positioning the mouse in OS X - Mac Programming

hello, -Is there a systemcall in OS X to position the mouse from within a user program, something like: x y setMouse ? (LMSetMouseLocation is not supported on X) -If not, does anyone know of a 3rd party framework which has the capabillities to do this? -Does anyone know how to use another computer as an usb-mouse? The other computer is sending x y values via usb to your computer, which sees and treats them as the mouse coordinates. We need this for the following situation: an object in a vertical plane, say 6*8 meters is tracked with a camera ...

  1. #1

    Default positioning the mouse in OS X

    hello,

    -Is there a systemcall in OS X to position the mouse from
    within a user program, something like: x y setMouse ?
    (LMSetMouseLocation is not supported on X)

    -If not, does anyone know of a 3rd party framework which
    has the capabillities to do this?

    -Does anyone know how to use another computer as an usb-mouse?
    The other computer is sending x y values via usb to your
    computer, which sees and treats them as the mouse coordinates.

    We need this for the following situation:
    an object in a vertical plane, say 6*8 meters is tracked with
    a camera by computer1 which scales it to the x/y coordinates
    for a 600*800 pixels screen. Computer1 sends these values to
    computer2, where they're used as input parameters in an audio
    program: it lookes at the mouse.
    Both processes are too 'heavy' to run simultaneously on one
    computer, we need two. At the moment we use ethernet to connect
    the two computers.

    -If anyone knows of an existing/availlable solution which is
    simpler than the video-tracking way of positioning the mouse
    (radio-sender/receivers -> usb), we would be very gratefull!
    Note: it's about scaling huge/tiny movements by some object
    to mouse movements on the screen.

    any help, pointers or information highly appreciated
    many regards,
    on behalf of BMB con.
    -Roelf Toxopeus

    http://this.is/bmbcon
    Roelf Guest

  2. #2

    Default Re: positioning the mouse in OS X

    > -Is there a systemcall in OS X to position the mouse from 

    In one of the Core Graphics headers (CGRemoteOperation.h) I found the
    following:


    /*
    * Warp the mouse cursor to the desired position in global
    * coordinates without generating events
    */
    CG_EXTERN CGEventErr CGWarpMouseCursorPosition( CGPoint newCursorPosition );


    I haven't tried it, don't know if it works.

    Regards,
    Mani
    --
    LittleSecrets, iVolume, SharingMenu:
    http://www.mani.de/

    Manfred Guest

  3. #3

    Default Re: positioning the mouse in OS X

    In article <BBA88DF2.1B19B%de>,
    Manfred Lippert <de> wrote:
     

    Great, this looks very promissing!!

    Result:

    The good thing is, the involved sound application reacts immediately
    to the mouse change, so that's solved, thank you.

    But ...

    So far the mouse moves to the top left corner of the screen, whatever
    coordinates I provide in the CGPoint.
    I tried CGDisplayMoveCursorToPoint with the same result.

    Both functions return noErr.

    Any clue?

    -r
    Roelf Guest

  4. #4

    Default Re: positioning the mouse in OS X

    In article <teranews.com>,
    Roelf Toxopeus <com> wrote:
     

    (Just for the record, in case someone is searching the archives for a
    function to move the mousecursor)

    It's working.

    For the non C experienced programmers like silly me:
    the CGPoint in the call is not a pointer to a structure, i.e. address,
    but it means the contents, the x and y floats.
    CGEventErr CGWarpMouseCursorPosition( float x, float y);
    would have made it clear immediately. Providing the two
    floats directly to the call made it work.

    : moveMouse ( xfloat32 yfloat32 -- ) _CGWarpMouseCursorPosition drop ;

    -r
    Roelf Guest

Similar Threads

  1. Help with Mouse Within and Mouse Leave problem...
    By Khanh75 webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 2
    Last Post: December 3rd, 08:22 PM
  2. USB Mouse: HP Wireless Optical Mouse
    By M. in forum Linux Setup, Configuration & Administration
    Replies: 3
    Last Post: September 25th, 06:02 AM
  3. Move mouse cursor to X,Y location and simulate mouse click
    By WZSun in forum Macromedia Director Lingo
    Replies: 1
    Last Post: August 6th, 10:17 AM
  4. Replies: 0
    Last Post: June 29th, 02:30 PM
  5. Fading alpha on mouse over/mouse off
    By Fry in forum Macromedia Flash
    Replies: 2
    Last Post: June 29th, 10:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139