Hi all.
I'm trying to make gamepad work with my program.
After a lot search, I installed xserver-xorg-input-joystick, and copied 52-MyLinuxJoystick.conf to
/usr/share/X11/xorg.conf.d/52-MyJoystick.conf.
This is my system information:
- OS: Ubuntu 16.04 LTS 64bit
- Matlab: 2016a
- PTB: 3.0.13
- Gamepad: Logitech Gamepad F310
- Mouse: Alienware TactX Mouse
Now I can get devices by [index, name] = GetGamepadIndices(), which returns:
index =
2 11 12 15 13 14
name =
Columns 1 through 3
'Virtual core XTES…' 'Alienware Alienwa…' 'Alienware Alienwa…'
Columns 4 through 6
'ETPS/2 Elantech T…' 'Logitech Gamepad …' 'Logitech Gamepad …'
However, devices = PsychHID('Devices') only returns a 1x2 struct array:
0 0 'TBD' 1 '0003:0005:01' 6268 1301 24833 'Alienware' 'Alienware TactX Mouse' 'A75DA9EFEF0011' 196613 1 0 0 0 0 0 0 0 0 0 0 0
1 2 'TBD' 2 '0003:0005:00' 6268 1301 24833 'Alienware' 'Alienware TactX Mouse' 'A75DA9EFEF0011' 196613 0 0 0 0 0 0 0 0 0 0 0 0
And when I use [x,y,buttons] = GetMouse([], index), only index 12 returns the gamepad input, and it only respond to 4 buttons on the right side (a, b, x, y). But isn't 12 correspond to the 3rd device name which is 'Alienware Alienware TactX Mouse'?
- What is the relationship between index and name returned by GetGamepadIndices()?
- How can I get PsychHID identify my gamepad?
- How can I get other buttons' input?
Thanks!!