Specify that we support variable mode, which will cause drivers to switch to

that mode when they support it. Right now there is only usb_hid though. With
this commit controllers with an arbitrary number of axes, hats and buttons are
now supported by BJoystick and by the BJoystick <-> driver protocol as well as
by usb_hid (usb_hid doesn't yet have support for hats though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41893 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2011-06-03 21:15:45 +00:00
parent 596bb6891a
commit 894a3ebe89

View File

@ -141,6 +141,9 @@ BJoystick::Open(const char *portName, bool enhanced)
_BJoystickTweaker joystickTweaker(*this);
joystickTweaker.GetInfo(fJoystickInfo, portName);
// signal that we support variable reads
fJoystickInfo->module_info.flags |= js_flag_variable_size_reads;
LOG("ioctl - %d\n", fJoystickInfo->module_info.num_buttons);
ioctl(fFD, B_JOYSTICK_SET_DEVICE_MODULE, &fJoystickInfo->module_info,
sizeof(joystick_module_info));