Set Joystick position using psychtoolbox - joystick

I am running an experiment involving a joystick (cannot use a mouse for technical reasons), using psychtoolbox version 3, on a linux computer. At discrete time-points in the experiment, I need to place the joystick cursor at pre-determined points on the screen, so that the participant can move the cursor from there. However, psychtoolbox does not seem to have a command to do this. I can get this to work using a mouse, but not with a joystick. I tried the SetMouse command, but it does not seem to work for the joystick cursor. Does someone have any idea?

Related

p5.js, WAAClock, and Changing Tempo During Sketch

Good evening all;
I am continuing working on a project, which is essentially a drum machine whose tempo you can adjust in real time using a slider. That is, you can set up the drum machine and play it and as it's playing you can use a slider to affect its tempo in real-time. I successfully coded this in Processing 3 and 4, but I want to have it available on the web via p5.js, but am having some difficulty... I have gotten the drum machine setup in p5.js using Tone.js and WAAClock, but because I've set up the bpm variable in Setup() via a clockSetup() function (without otherwise I cannot get the drum machine to work), I can't use a slider to change the tempo in real-time. Is there a way to affect the tempo, which is currently set to 60bpm, using a slider?
To use the drum machine, click on a square that you want to activate per the row item (e.g., bottom row is the Bass Drum, the middle row is the Snare Drum) and then press the spacebar.
Here is the code on OpenProcessing: https://openprocessing.org/sketch/1734625
Apologies if this is not the right way to request assistance, still new to asking for support. :)
Also, to note, I'm using Tone.js instead of p5.sound, because Tone.js uses less RAM. p5.js causes the Sketch to crash within a minute of running the drum machine, but with Tone.js, I can run it for hours.
I tried to adjust 'bpm' in draw(), in a function, and to remove it from setup() and try to only set it up in draw(), but haven't been able to figure it out.

How to manually draw a mouse cursor on MacOS?

For a screen sharing collaborative app, it is desirable to give the remote party a mouse cursor also.
Is it possible to leverage NSCursor?
If not, I guess I must create a small accurately positioned top-level window displaying a bitmap (I've asked here if there is some way to retrieve the bitmaps from the system cursors).
Code/link contributions appreciated. If I figure it out first I will (as always) answer my own question.

how would i go about emulating mouse devices correctly?

I have a device simulation framework vbscript file I use to create emulated usb mouse devices but I have a problem: how can I pass x,y for a specific usb mouse device without ending the script before all mouse devices are done? I thought about it and could use a file with x,y values but that might slow down the speed at which responses are received or not be in real time in worried about.
An example would be me sending 3,3 for x,y for device 0 during first loop then second loop i send 4,4 for x,y for device1. Im stumped as to how this can be done.
Anyone have any ideas?
Code for reference is here:
http://kinectmultipoint.codeplex.com
I just need to organize the code properly but I will try the file idea while wating on response
I just have implementation of my mouse program with kinect now i figured out the answer to this. Please visit link above to download code and no its not a direct download link you need to select downloads from top navigation bar and go to correct download.
If you wish to help me improve the code i've started combined the kinect and vbscript file together and progress is good but need successful two person kinect test.
I used command line paramters in vbscript to pass parameters with the mouse data.
Might in future research making an emulated multi-mouse driver because i dont like using the vbscript.

Prevent program from using ClipCursor?

An old game (Pod) is kept alive with a glide wrapper and thus can now be run in custom resolutions larger than the native game resolution which was 640x480.
However, due to problems with the glide wrappers, if the game is run at 1920x1080 for example, the cursor is only allowed to move in a 0, 0, 640, 480 rectangle; obviously the WinAPI ClipCursor function has been used by the original developers for this.
This is pretty nasty because you can't act with the game menu mouse-wise in a useful way since not all buttons can be reached.
Is it possible to disable ClipCursor() functionality globally? Do I have to inject a DLL (I didn't do this completely before) or would it just be enough to let a C# app run in the background, watching for the game process and setting ClipCursor() to the real screen area after the process has been started?
I seriously doubt it's calling ClipCursor() more than once. Try writing a small program to call ClipCursor() and set it back to the size of your desktop. Run that program after your game is started.
edit
Depending on your skill level, you could also try using ollydbg to step through the program and find where it's calling the ClipCursor() API, and insert a jump to skip over it.

How to Insert my Code Between Zoom Text and Windows?

I am writing an application whose users will use ZoomText and a tablet PC. ZoomText is screen magnification software. However ZoomText has a bug that prevents tablet tracking from working correctly, meaning finger and pen interaction with the screen is incorrect. When you zoom in on a rectangle in the screen and tap on something, you are actually tapping on the absolute coordinates, as if ZoomText was not running.
I am trying to write a program that will correct this behavior. ZoomText has a COM API which allows me to know the zoom amount and location. This means that if I were able to get between ZoomText and the operating system, I could intercept the pen/touch input, translate the coordinates taking into account ZoomText's zoom and location, and then pass the input back to the operating system.
Where should I begin? I don't even know where to start looking for how to implement this.
I think the way to go about this is a low level mouse hook. Use SetWindowsHookEx with a hook type of WH_MOUSE_LL.

Resources