Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 4 of 4

Thread: custom item for tracking XY joystick/mouse movements

  1. #1
    Join Date
    May 2006
    Posts
    16

    custom item for tracking XY joystick/mouse movements

    Hi,

    This is a topic I have brought up before, so I am sorry for raising it again. I am looking to capture joystick or mouse movements continuously every second or at an even finer distinction. I know DirectRT does this very well. However, DirectRT does not seem to allow me to provide the graphical feedback real time to the subject. In other words, the subject cannot see the scales on which s/he is evaluating an item. Ideally, I would like to present an image on one side and a graphical window on the other that shows the mouse/joystick movement as a moving cursor in the XY plane. Medialab has the custom item feature, so I am not sure whether a possible option is for me to embed the image in an HTML form and have a javascript to capture the continuous movements. I have a consultant who is willing to write a java script program for me, but he needs some guidance. Specifically, if I designate the HTML form as a custom item, will Medialab be able to store the XY coordinates from the javascript program? Or, does the programmer have to also enable writing of the data to a separate csv file?
    Would greatly appreciate a prompt reply!!!!

  2. #2
    Join Date
    Nov 2005
    Posts
    3,318
    I think this ought to be do-able, especially if you have a javascript programmer who is will to help you. You can tell the programmer that if they can get the script to work in IE then it ought to work just fine in MediaLab. You need to tell them that the data need to be passed like form data using the method=post command. Because you could have a LOT of variables if you are sampling once per second (or even more frequently), you might consider having the data merged into fewer variables which can be sorted out later. E.g., instead of coordinates x=457, y=1036, at time 3050ms representing 3 separate variables, you could have this be a single string variable with a value of "457-1036-3050" or something like that.

    See also: www.empirisoft.com/support/showthread.php?t=536

    And ps., I'll be happy to help if you need it. See how far you can get with the javascript and then let me know if you run into any trouble with it. Sounds like a great custom item!

  3. #3
    Join Date
    May 2006
    Posts
    16
    Thanks! I have forwarded your message to the programmer and he has indicated that he is thinking along the same lines. He sent me a prototype that worked ok, except for one problem - the javascript did not sample the position at the same intervals of time. I had asked him to try a 15-16 ms resolution, but the program wrote data anywhere between every 16 ms to 64 ms over the course of the sampling. I have asked him to try a 100 ms resolution - hopefully that should work!

  4. #4
    Join Date
    Nov 2005
    Posts
    3,318
    This code sample might help--it's a simple example of some javascript rt code. Never used it myself but thought it might help in your case.
    Attached Files Attached Files

Similar Threads

  1. Custom item - Autosum
    By akipaki_sf5 in forum MediaLab Older Versions: Sharing Area
    Replies: 16
    Last Post: 12-06-2008, 02:31 PM
  2. Blank screen on custom item
    By njsporn in forum MediaLab Older Versions: Troubleshooting
    Replies: 1
    Last Post: 07-27-2007, 07:17 AM
  3. Create a custom instruction item?
    By jarvis24 in forum MediaLab Older Versions: How Do I...
    Replies: 1
    Last Post: 07-23-2007, 10:31 AM
  4. Hiring a programmer for a custom item?
    By jarvis24 in forum MediaLab Older Versions: How Do I...
    Replies: 3
    Last Post: 11-17-2006, 08:26 AM
  5. custom item with background image
    By rkozink in forum MediaLab Older Versions: How Do I...
    Replies: 1
    Last Post: 05-04-2006, 01:10 PM

Posting Permissions

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