Welcome! Log In Create A New Profile

Advanced

Locking joystick position

Posted by curiousgeorge 
Locking joystick position
May 11, 2023 02:42PM
Is there is a method for "locking" the joystick position, so that the subject cannot move it during a specific period of trial?

I would like to hide the joystick with joy_.showcursor(false) and then lock it as well, so when it is not shown, the subject cannot change the position of the joystick. At the moment, even if joystick is not visible via the showcursor method, it can still be moved.

As well I was wondering if there was a method like mouse.setCursorPos([xdeg ydeg]) for JoyTracker.

Thank you
Re: Locking joystick position
May 11, 2023 05:51PM
Joystick is not the same as mouse. A mouse movement displaces the cursor from its current position, but tilting the joystick handle displaces the cursor from the origin. Keep this in mind and try the attached example.

If what you want is to change the origin of the joystick cursor, see this manual page.
https://monkeylogic.nimh.nih.gov/docs_CoordinateConversion.html
Attachments:
open | download - curiousgeorge.zip (880 bytes)
Re: Locking joystick position
May 15, 2023 09:51AM
Thank you for your response Jaewon.

On another note, is it possible to change the color of the joystick cursor within the timing file (or any of the task scripts for that matter)?

I would like to cue the current block via the joystick cursor on the screen, and therefore color it differently depending on the current block/trial conditions.

Thanks again
Re: Locking joystick position
May 16, 2023 04:19PM
That functionality has been removed for a long time. Let me think about how to put it back.
Re: Locking joystick position
May 24, 2023 03:48PM
Download the new version. It will allow you to change the joystick cursor in the timing script. Refer to the attached example and also the following manual page.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#JoyCursor
Attachments:
open | download - curiousgeorge2.zip (755 bytes)
Re: Locking joystick position
June 01, 2023 10:27AM
Thank you for this addition Jaewon!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.