How can I get events from a generic USB HID device in Psychtoolbox-3?

2.2k Views Asked by At

I have a Griffin Technology 'PowerMate' USB knob. It's apparently HID compliant, and I'm able to detect it with the following bit of code:

 LoadPsychHID;
devs = PsychHID('Devices');
for i = 1:length(devs)
    index = devs(i).index;
    if strfind(devs(i).product, 'PowerMate')
        break
    end
end

The device index is 1.

I then try to start an event queue for the device:

KbQueueCreate(index);
PsychHID('KbQueueStart', index);

No errors so far, so I check it with CharAvail

[avail, numChars] = CharAvail

avail =

     0


numChars =

     0

Furthermore, running [have_events, a, b, c, d] = KbQueueCheck(index); returns a boolean True for the variable have_events and empty matrices for variables a, b, c and d.

What am I doing wrong? Any suggestions?

EDIT: For what it's worth, I don't need very accurate timing here, so if there's a way to get this to work in plain-old Matlab, that's also fine. No need to use Psychtoolbox if it's not strictly necessary!

Thanks!

0

There are 0 best solutions below