to build a new descriptor using a HIDWriter. This way a completely new
descriptor can be built on the fly or a fixed already patched blob can be
written to the writer if desired.
* Implemented writing a new report descriptor for Sony SIXAXIS controllers. The
descriptor also includes the pressure sensitive button states (exposed as 12
axes) and the accelerometers/gyroscope (exposed as another 4 axes). While the
motion sensing data is now available (and fun to look at), the usefulness is
fairly limited, as the values are not scaled/transformed in any way. It might
be possible to generically do such transformations using unit descriptions,
but those are not implemented yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41925 a95241bf-73f2-0310-859d-f6bbb57e9c96
duplicate usages and simply adds more axes in that case. It also removes the
gaps that were previously put in place if there were higher numbered axes.
However, since the ordering of the axes now depends on the ordering inside the
HID collection, it is possible that some controllers won't have the X, Y and Z
axis mapped as the first three axes, which might confuse applications. I've not
encountered a report structure that would lead to such a situation yet, but then
again the amount of reports I was able to get hold of is fairly limited. If it
becomes a problem the mapping needs to be adjusted accordingly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41923 a95241bf-73f2-0310-859d-f6bbb57e9c96
report descriptors. These descriptors aren't optimized for efficiency (the
writer doesn't attempt to avoid writing unneeded global items for example) but
they will only serve as input for the HIDParser that parses them correctly
regardless.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41921 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Only cancel the update thread if the last open instance is closed. This fixes
that other applications using the same joystick would stop getting updated
values as soon as one application was closed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41905 a95241bf-73f2-0310-859d-f6bbb57e9c96
is now searched before the LIBRARY_PATH/ADDON_PATH. Fixes#7638.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41903 a95241bf-73f2-0310-859d-f6bbb57e9c96
function that is triggered before the protocol handlers are added.
* Use the quirky device mechanism to support the Sony SIXAXIS controller (the
PS3 one). It requires a specific get_report to become operational. Note that
you still have to push the PS button to enable it after plugging in. Note also
that only the two analog sticks are reported as axis, the analog values of the
buttons as well as the motion sensors aren't described by the HID descriptor
and therefore aren't accessible. The digital button states (on/off only) work
however. A fixed descriptor could possibly be crafted to support the missing
features later on though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41902 a95241bf-73f2-0310-859d-f6bbb57e9c96
handlers. A full sized keyboard is assumed when LEDs are found and those are
preferred then. This makes USB keyboards work (at least those that worked
by voluntarily entering KDL before, i.e. those that are hooked up to UHCI root
ports) also when entering KDL by means of a panic. The first (few) keys are
swallowed though, but that's certainly better than it not working at all.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41898 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
The new asynchronous tracking doesn't lock the view and makes desktop
replicants happy while clicking and dragging around. Fixes#880, #7241
and certainly other tickets, that i will revisit, about refresh locks
on the desktop or mouse related bugs. Based on a reusable MessageFilter and the
recent B_MOUSE_IDLE message. Some parts are ported from the old code
and could use further simplification.
There should be no intentional user fonctional change, except:
- slightly bigger threshold radius, shorter duration thresholds
(= 1.0 x the system-wide doubleclick setting)
- not reimplemented: quickening threshold when holding shift while dragging
a pose over a destination pose.
Some parts are ported from the old code and could use further simplification.
There is one known minor regression with autoscrolling while
rect-selecting but that will be better fixed with some changes to the
autoscroll code. Will address that ASAP. As for the unknown regressions,
please test :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41892 a95241bf-73f2-0310-859d-f6bbb57e9c96
both, variable and extended joystick mode, using the same mechanism of mimicing
the extended_joystick structure with the variable one if required. The mode
used depends on the support flag coming in from BJoystick (currently off), so
with this commit the behaviour doesn't change. I'm going to flip that switch
next though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41891 a95241bf-73f2-0310-859d-f6bbb57e9c96
methods the members are populated, the flat data size is calcualted, the data
buffer is allocated and the convenience pointers are set up automatically. With
initialize() an arbitrary configuration can be created, with
initialize_to_extended_joystick() a configuration is created that exactly
matches the data structure of the extended_joystick struct.
Having them here makes it easy to use the structure from a driver as well
without the need to set up everything manually.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41888 a95241bf-73f2-0310-859d-f6bbb57e9c96
into joystick_driver.h as it is convenient to have also on the driver side.
* Added comments explaining the data structure and use case of the structure.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41886 a95241bf-73f2-0310-859d-f6bbb57e9c96
inside BJoystick.
* Add joystick_module_info flag to communicate support for variably sized reads.
* The variably sized data structure is set up to describe either the actual
amount of data, when variably sized reads are supported by the driver, or it
is set up so that it exactly matches the data layout of the extended_joystick
structure. This allows us to support both as input data, while only needing to
care about a single format inside BJoystick. Convenience pointers allow the
data to be retrieved without additional overhead or extra logic.
* Add some sanity checks and ensure some boundaries when dealing reading data
from the variably sized structure (as there might not be any buttons, hats,
axis at all now).
* Ensure that the extended_joystick structure doesn't change in size due to
padding by making it _PACKED (it wasn't padded though).
This is still supposed to work exactly as before. However, it opens up the
possibility to actually support arbitrary controllers with arbitrary axis, hat
and button counts. It therefore allows to actually deliver what the BJoystick
API was designed to handle all along.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41885 a95241bf-73f2-0310-859d-f6bbb57e9c96
be retrieved. I think the fixed layout will actually make it impossible to see
anything beyond the 9th button however... The coding style of this app is,
different, to say the least and I didn't really bother fixing it up right now,
so the changes just mimic what's there.
* Some automatic whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41883 a95241bf-73f2-0310-859d-f6bbb57e9c96
Get*Values() functions but retrieves an arbitrary amount of button states using
a boolean array. This overcomes the 32 button limitation on the API side. Right
now the function does simply set the first 32 states from the button bitmap, as
the BJoystick to driver interface hasn't been adapted yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41882 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added an arch_debug_gdb_get_registers() interface that is supposed to provide
the register values in the format expected by gdb and implemented it for x86.
* Reimplemented gdb_regreply() to use that. Also made it buffer overflow safe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41880 a95241bf-73f2-0310-859d-f6bbb57e9c96
already anyway (as compared to the original BeOS ones) this won't introduce any
missing symbols.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41879 a95241bf-73f2-0310-859d-f6bbb57e9c96
declarations to group them more logically. No functional changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41878 a95241bf-73f2-0310-859d-f6bbb57e9c96
documented in the BeBook. Sadly the success return is specified as "a positive
integer", so I didn't change it to B_OK.
* We actually want non-blocking mode, so don't reset the O_NONBLOCK flag. It was
ignored before anyway though, so this doesn't change anything.
* The legacy buttons 1 and 2 are in the pressed state when false, so initialize
them to true instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41876 a95241bf-73f2-0310-859d-f6bbb57e9c96
(which is uint32), but the legacy BJoystick axis values are just the same int16
as the ones in extended mode, so nothing has to be done besides assigning them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41875 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed some coding style and a few sanity checks where it make sense.
This driver code is not in a good shape and needs a wide cleanup.
unfortunatly, I still don't have any device to test with, so I can't do that anytime soon.
Intead of letting his patch collecting dust since 3 months (my bad),
I think it's better the multi-port support gets at least more exposure than
just Pete's hardware.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41874 a95241bf-73f2-0310-859d-f6bbb57e9c96
to be updated with newly plugged in devices without the need to recreate a
BJoystick object.
* Do an initial (re-)scan on object creation instead of always scanning in
CountDevices() and by extension GetDeviceName().
* This makes CountDevices() and GetDeviceName() stable with regards to the
device list, so that an enumerating application doesn't suddenly get more/less
devices than it might expect.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41870 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Include sorting, header style, macro naming, variable naming, spacing, ...
* Some simplifications, early returns and the like.
* The device name list items were allocated with new but deleted with free. The
whole private BJoystick list being modified by a friend class is dubious
though and should be reworked. Ideally node monitoring would be implemented
so that the list can be re-populated on demand instead of scanning through
every time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41868 a95241bf-73f2-0310-859d-f6bbb57e9c96
with the BJoystick requirements:
* Make the Read() non-blocking. This is required as BJoystick is a polling
interface. A single current state is used that is updated by a separate thread
on report arrival. The thread is spawned as soon as the ProtocolHandler is
opened for the first time (and quit at the first wait return after the
ProtocolHandler is closed). With this we can simply return the current state
on read.
* Remove the ring buffer as it was not needed in the first place. This also
happens to solve the problem of sharing a JoystickProtocolHandler. Before,
concurrent reads would queue up the same result multiple times in the ring
buffer and then return stale data on the next update.
Solves most of #7629.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41865 a95241bf-73f2-0310-859d-f6bbb57e9c96
ever wait for reports on demand, there's no need for buffering at all.
This removes some unnecessary copying and ring buffer overhead, the ring buffer
will now in fact not be created at all.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41864 a95241bf-73f2-0310-859d-f6bbb57e9c96