History log of /haiku/src/kits/device/Joystick.cpp (Results 1 – 25 of 27)
Revision Date Author Comments
# 9b83a2a0 21-Jun-2018 Augustin Cavalier <waddlesplash@gmail.com>

BJoystick: Fix fJoystickInfo initialization.

joystick_info contains BLists which initialize themselves upon new(),
and Clang warned (correctly) that using memset() overwites that, as well as
RTTI an

BJoystick: Fix fJoystickInfo initialization.

joystick_info contains BLists which initialize themselves upon new(),
and Clang warned (correctly) that using memset() overwites that, as well as
RTTI and other data that they contain. So instead, only memset the first
part of the struct, and then manually initialize the other members.

Fixes #14217.

show more ...


# 894a3ebe 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

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 num

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

show more ...


# e0f0271a 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Use the appropriate initialize*() method instead of setting up the structure
manually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41889 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e0cca2f 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Remove the JoystickPrivate.h again and move the variable_joystick structure
into joystick_driver.h as it is convenient to have also on the driver side.
* Added comments explaining the data struct

* Remove the JoystickPrivate.h again and move the variable_joystick structure
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

show more ...


# ab176368 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Replace the fixed size extended_joystick structure with a variably sized one
inside BJoystick.
* Add joystick_module_info flag to communicate support for variably sized reads.
* The variably size

* Replace the fixed size extended_joystick structure with a variably sized one
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

show more ...


# 4b5bcc66 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Introduce a BJoystick::GetButtonValues() function that aligns with the other
Get*Values() functions but retrieves an arbitrary amount of button states using
a boolean array. This overcomes the 32 but

Introduce a BJoystick::GetButtonValues() function that aligns with the other
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

show more ...


# bb2420a4 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Remove two unimplemented private functions. Since their signature was changed
already anyway (as compared to the original BeOS ones) this won't introduce any
missing symbols.


git-svn-id: file:///sr

Remove two unimplemented private functions. Since their signature was changed
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

show more ...


# 1147fabd 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Move function definitions to match their declaration order. Also move some
declarations to group them more logically. No functional changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@4187

Move function definitions to match their declaration order. Also move some
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

show more ...


# 2682d2fb 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Return early when opening the device failed and just return B_ERROR as
documented in the BeBook. Sadly the success return is specified as "a positive
integer", so I didn't change it to B_OK.
*

* Return early when opening the device failed and just return B_ERROR as
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

show more ...


# 30e429b4 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

I was mislead by the legacy joystick structure data type for the axis values
(which is uint32), but the legacy BJoystick axis values are just the same int16
as the ones in extended mode, so nothing h

I was mislead by the legacy joystick structure data type for the axis values
(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

show more ...


# 464e0351 02-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Add a BJoystick::RescanDevices() public function. It allows the BJoystick
to be updated with newly plugged in devices without the need to recreate a
BJoystick object.
* Do an initial (re-)scan

* Add a BJoystick::RescanDevices() public function. It allows the BJoystick
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

show more ...


# a00ac739 02-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Ensure that a GetDeviceName() call triggers a ScanDevices() as well, as it can
be called without calling CountDevices().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41869 a95241bf-73f2-0310

Ensure that a GetDeviceName() call triggers a ScanDevices() as well, as it can
be called without calling CountDevices().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41869 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 393ca9a1 02-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Cleanup of the _BJoystickTweaker:
* Include sorting, header style, macro naming, variable naming, spacing, ...
* Some simplifications, early returns and the like.
* The device name list items were al

Cleanup of the _BJoystickTweaker:
* 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

show more ...


# ef13dbda 31-May-2011 Michael Lotz <mmlr@mlotz.ch>

* Actually implement the relevant parts of BJoystick, i.e. reading the joystick
info and values. Inspired by and in parts based on the patch by caz_haiku in
ticket #7429 (though rewritten complet

* Actually implement the relevant parts of BJoystick, i.e. reading the joystick
info and values. Inspired by and in parts based on the patch by caz_haiku in
ticket #7429 (though rewritten completely due to the other changes). Thanks
for the pointers!
* Clean up the mixup of internal joystick info and the one from
joystick_driver.h so that BJoystick and the drivers talk about the same
structures.
* Extensive coding style cleanup, simplifications, NULL checks, early returns,
std::nothrow allocations, include sorting, argument naming, ... that kind of
stuff.
* Added some TODO notes for remaining stuff.
* Automatic (and manual) whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41849 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# cb90adfa 10-Mar-2011 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Partly revert the previous commit: don't reset ffd in the destructor since
it's useless.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40902 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aac111dc 10-Mar-2011 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Initialize ffd to -1 in the constructor otherwise many checks may fail
afterwards, and BJoystick won't work.
Also reset it to -1 in the destructor for symmetry.
Found by Carwyn Jones. Thanks!


git-s

Initialize ffd to -1 in the constructor otherwise many checks may fail
afterwards, and BJoystick won't work.
Also reset it to -1 in the destructor for symmetry.
Found by Carwyn Jones. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40900 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 6cb744fe 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed debug build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34266 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e6b0851 11-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Applied (cleaned up) patch by Stefano to fix bug #4742.
* Note while this fixed running BeOS apps using BJoystick, it breaks all apps
(and SDL) that have been compiled for Haiku R1/alpha1. It's r

* Applied (cleaned up) patch by Stefano to fix bug #4742.
* Note while this fixed running BeOS apps using BJoystick, it breaks all apps
(and SDL) that have been compiled for Haiku R1/alpha1. It's really bad that
r27171 went through unnoticed. We should really try harder next time (and
try to get the ABI change detection script working in an automated way).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33520 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 4cc3ec9f 23-Oct-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved _joystick_info definition to JoystickTweaker.h, since there is no point to keep it public. Removed default parameter in the second version of Open(), otherwise the two functions can't be used u

Moved _joystick_info definition to JoystickTweaker.h, since there is no point to keep it public. Removed default parameter in the second version of Open(), otherwise the two functions can't be used unambiguously. Should fix bug #2904

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28291 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 4239ee5d 12-Sep-2008 Ryan Leavengood <leavengood@gmail.com>

Fixed CID 1290 and 1291: the temp BString is initialized with a new BString and then immediately replaced. A later null check ensures it is OK to initialize it to NULL.

Also fixed a GCC warning abou

Fixed CID 1290 and 1291: the temp BString is initialized with a new BString and then immediately replaced. A later null check ensures it is OK to initialize it to NULL.

Also fixed a GCC warning about comparison between signed and unsigned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27434 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 6ecf7db5 23-Aug-2008 Fredrik Modeen <fredrik@modeen.se>

Code cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27172 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8f38768e 11-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Don't define DEBUG in public headers!!! Doing it this way will break the
build for others, namely those that also include <Debug.h>
* This fixes the remaining problems of building Pe under Haiku.

* Don't define DEBUG in public headers!!! Doing it this way will break the
build for others, namely those that also include <Debug.h>
* This fixes the remaining problems of building Pe under Haiku.
* Those files need a giant style cleanup... Fredrik, time to have a look at
our style guide :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26931 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# b555dcbd 04-Aug-2008 Fredrik Modeen <fredrik@modeen.se>

comment fix and fixed some return error from BeBook

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26784 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a14895cc 03-Aug-2008 Fredrik Modeen <fredrik@modeen.se>

Read's the joystick description file

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26764 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 631d09ac 08-Jun-2008 Jérôme Duval <korli@users.berlios.de>

gcc4 build fix


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25866 a95241bf-73f2-0310-859d-f6bbb57e9c96


12