From 894a3ebe898db2b8b538dc417050a1bcec36dfad Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 3 Jun 2011 21:15:45 +0000 Subject: [PATCH] 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 --- src/kits/device/Joystick.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kits/device/Joystick.cpp b/src/kits/device/Joystick.cpp index 768ad1b696..6ec405de78 100644 --- a/src/kits/device/Joystick.cpp +++ b/src/kits/device/Joystick.cpp @@ -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));