2

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!

Louis Thibault
  • 20,240
  • 25
  • 83
  • 152
  • Note that your code does not work in every case. If `length(devs)` is equal to 1, your value `index` will be 1 no matter what `strfind(devs(i).product, 'PowerMate')` returns. – H.Muster Oct 15 '12 at 11:25
  • @H.Muster Good catch! This *shouldn't* be a problem since I have several devices that are returned by `PsychHID('Devices')`, but I'll correct this just to avoid any future headaches. Thanks for the advice! – Louis Thibault Oct 15 '12 at 11:32
  • Did you already read this (short) discussion concerning the PowerMate? http://tech.groups.yahoo.com/group/psychtoolbox/message/6914 – H.Muster Oct 17 '12 at 13:13
  • @H.Muster, I did. This is why I'm confused about my CharAvail output... Did I miss something? – Louis Thibault Oct 17 '12 at 20:50
  • Just some random questions: (1) Do you run matlab with the `-nojvm` option? (2) Did you try KBCheck? – H.Muster Oct 18 '12 at 06:48

0 Answers0