[haiku-commits] r41893 - haiku/trunk/src/kits/device

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 3 Jun 2011 23:15:45 +0200 (CEST)

Author: mmlr
Date: 2011-06-03 23:15:45 +0200 (Fri, 03 Jun 2011)
New Revision: 41893
Changeset: https://dev.haiku-os.org/changeset/41893

Modified:
   haiku/trunk/src/kits/device/Joystick.cpp
Log:
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).


Modified: haiku/trunk/src/kits/device/Joystick.cpp
===================================================================
--- haiku/trunk/src/kits/device/Joystick.cpp    2011-06-03 21:12:14 UTC (rev 
41892)
+++ haiku/trunk/src/kits/device/Joystick.cpp    2011-06-03 21:15:45 UTC (rev 
41893)
@@ -141,6 +141,9 @@
        _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));


Other related posts:

  • » [haiku-commits] r41893 - haiku/trunk/src/kits/device - mmlr