HID code for windows?

I need to write some code to collect responses from an HID-compliant device... on Windows. I see that PsychHID works only on MacOSX. I have a homemade three-button response box built out of a Saitek ST 90 USB joystick. Does anyone have any code that I could use? Or advice (besides "don't do it")?

thanks
Todd
--- In psychtoolbox@yahoogroups.com, "todd_horowitz" <toddh@...> wrote:
>
> I need to write some code to collect responses from an HID-compliant device... on Windows. I see that PsychHID works only on MacOSX. I have a homemade three-button response box built out of a Saitek ST 90 USB joystick. Does anyone have any code that I could use? Or advice (besides "don't do it")?
>

Don't do it!

But if it is a joystick (or the electronics from a regular joystick) and the response buttons just act like Joystick buttons then you could use our minimal WinJoystickMex() joystick driver to get the button state.

Usual precautions for rt measurements apply: If it is a joystick it is treated by the os as a joystick, which probably means it is only sampled at 8 msecs intervals.

-mario

> thanks
> Todd
>
[psychtoolbox] help with Octave
I'm having some difficulties with Octave and wondered if anyone had some advice. I've used Psychtoolbox for some time successfully with Matlab.

I'm on a recent Macbook Pro running OS X 10.6.4. I installed a pre-built Octave 3.2.3 from here:
http://octave.sourceforge.net/
and I altered the mkoctfile as described in the note.

I did SetupPsychtoolbox and it's updated to the current revision 1866.
Starting Octave brings up the terminal and it runs in there. (I immediately feel adrift without the development environment of the Matlab editor. Any suggestions for an editor to use that mimics at least some of that functionality, for example, being able to select some lines of code and execute.)

The program (my own) that I was hoping to run failed. It takes keyboard input via the Matlab/Octave "input" command input in the terminal as expected, Psychtoolbox starts with the white intro screen and opens a window and even draws my fixation cross, but then it hangs before showing my main stimuli. I have to force quit, and there are no error messages. Neither do my little disp('fixation drawn'),  disp('fixation flipped') etc messages show up. The "process complete" referring to the forced quit breaks into the PTB messages announcing everything at the beginning, because Terminal doesn't scroll through it all but waits for you to press for more. My program is in a try-catch loop but whatever the error, it's not being caught.

However Driftdemo and Dotdemo run just fine. KbDemo doesn't. Nothing shows in the Terminal at all, but if I press escape 3 times (which does show as ^[ ) it advances as it should to the 4th test with the rotating dot, which works with the arrow keys. Upon escaping that test 4, ALL of the expected text suddenly shows up in the terminal window, including the instruction text at the beginning (but it comes AFTER the previously echoed escape characters):

octave-3.2.3:1> KbDemo
^[^[^[1 of 4.  Testing KbCheck and KbName: press a key to see its number.
Press the escape key to proceed to the next demo.
You pressed key 41 which is ESCAPE

2 of 4. Testing KbCheck timing: please type a few keys.  (Try shift keys too.)
Type the escape key to proceed to the next demo.
"ESCAPE" typed at time 0.539 seconds

3 of 4.  Testing KbWait: hit any key.  Just once.
"ESCAPE" typed at time 0.534 seconds

4 of 4.  Done.
octave-3.2.3:2>

Because the image demos work, I'm hoping there is a simple explanation, maybe to do with how I'm mis-using the Terminal (with which I'm not that familiar). I believe I'm using 32-bit Octave but could it be 64-bit and that's the problem? How could I tell? Any other ideas or tips would be very welcome. (Also editor suggestions)

Thanks very much
Susan



Re: [psychtoolbox] help with Octave
Hello again, original poster here. I solved many of my problems with Octave today, and I  have my own program working. One thing for future reference that was causing hangs with no error messages was incorrect capitalizations of function names, for example calling SCREEN or screen instead of Screen. In Matlab, you get one warning per session the first error, and then it shuts up. Octave breaks out with an error every time. I seemed to have fixed something so that I'm seeing all my error messages in the Terminal I was missing before, so that has solved a lot.

The odd behavior with KbDemo still happens though!

I'm also still interested in pointers to Octave/PTB tips, resources, and editor suggestions.

Thanks,
Susan


I'm having some difficulties with Octave and wondered if anyone had some advice. I've used Psychtoolbox for some time successfully with Matlab.

I'm on a recent Macbook Pro running OS X 10.6.4. I installed a pre-built Octave 3.2.3 from here:
http://octave.sourceforge.net/
and I altered the mkoctfile as described in the note.

I did SetupPsychtoolbox and it's updated to the current revision 1866.
Starting Octave brings up the terminal and it runs in there. (I immediately feel adrift without the development environment of the Matlab editor. Any suggestions for an editor to use that mimics at least some of that functionality, for example, being able to select some lines of code and execute.)

The program (my own) that I was hoping to run failed. It takes keyboard input via the Matlab/Octave "input" command input in the terminal as expected, Psychtoolbox starts with the white intro screen and opens a window and even draws my fixation cross, but then it hangs before showing my main stimuli. I have to force quit, and there are no error messages. Neither do my little disp('fixation drawn'),  disp('fixation flipped') etc messages show up. The "process complete" referring to the forced quit breaks into the PTB messages announcing everything at the beginning, because Terminal doesn't scroll through it all but waits for you to press for more. My program is in a try-catch loop but whatever the error, it's not being caught.

However Driftdemo and Dotdemo run just fine. KbDemo doesn't. Nothing shows in the Terminal at all, but if I press escape 3 times (which does show as ^[ ) it advances as it should to the 4th test with the rotating dot, which works with the arrow keys. Upon escaping that test 4, ALL of the expected text suddenly shows up in the terminal window, including the instruction text at the beginning (but it comes AFTER the previously echoed escape characters):

octave-3.2.3:1> KbDemo
^[^[^[1 of 4.  Testing KbCheck and KbName: press a key to see its number.
Press the escape key to proceed to the next demo.
You pressed key 41 which is ESCAPE

2 of 4. Testing KbCheck timing: please type a few keys.  (Try shift keys too.)
Type the escape key to proceed to the next demo.
"ESCAPE" typed at time 0.539 seconds

3 of 4.  Testing KbWait: hit any key.  Just once.
"ESCAPE" typed at time 0.534 seconds

4 of 4.  Done.
octave-3.2.3:2>

Because the image demos work, I'm hoping there is a simple explanation, maybe to do with how I'm mis-using the Terminal (with which I'm not that familiar). I believe I'm using 32-bit Octave but could it be 64-bit and that's the problem? How could I tell? Any other ideas or tips would be very welcome. (Also editor suggestions)

Thanks very much
Susan
Thanks Mario, that works!

It might be useful to add the usage info to the function documentation on the wiki.

Todd

--- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@...> wrote:
>
>
>
> --- In psychtoolbox@yahoogroups.com, "todd_horowitz" <toddh@> wrote:
> >
> > I need to write some code to collect responses from an HID-compliant device... on Windows. I see that PsychHID works only on MacOSX. I have a homemade three-button response box built out of a Saitek ST 90 USB joystick. Does anyone have any code that I could use? Or advice (besides "don't do it")?
> >
>
> Don't do it!
>
> But if it is a joystick (or the electronics from a regular joystick) and the response buttons just act like Joystick buttons then you could use our minimal WinJoystickMex() joystick driver to get the button state.
>
> Usual precautions for rt measurements apply: If it is a joystick it is treated by the os as a joystick, which probably means it is only sampled at 8 msecs intervals.
>
> -mario
>
> > thanks
> > Todd
> >
>