SFML community forums

General => Feature requests => Topic started by: ExcessNeo on August 14, 2007, 05:49:53 am

Title: More Joystick Axis/Buttons
Post by: ExcessNeo on August 14, 2007, 05:49:53 am
A suggestion for a future release.



Keep up the good work  :D
Title: More Joystick Axis/Buttons
Post by: Laurent on August 14, 2007, 09:08:49 am
The current specs for the joysticks are limited by the Win32 implementation, but I think I can find a way to improve it.

I keep it for a future release ;)
Title: More Joystick Axis/Buttons
Post by: bibi.skuk on August 16, 2007, 10:55:53 pm
In the win32 api, there is JOYINFOEX struct, which is an extension of the JOYINFO you have used

http://msdn2.microsoft.com/en-us/library/ms709358.aspx

with that you have 6 axes, 32buttons, and 15 joysticks (except for windows NT4, which only have 2)
Title: More Joystick Axis/Buttons
Post by: mweb on August 17, 2007, 12:36:00 am
maybe you could have look at OIS http://sourceforge.net/projects/wgois. This is an input library that supports Windows/Linux and if I'm not wrong also Mac.
Since it is also under the zlib/libpng license there should not be any problem to use or integrate it. Why write everything your self ;-). Especially since the support of joysticks is quite good there and in the next version it will even support the Wii mote.
I don't know what had made with his webpage but he had one with some small tutorials how to use it. But there is still an example in the source code.
Title: More Joystick Axis/Buttons
Post by: Laurent on August 17, 2007, 08:51:59 am
I've downloaded OIS and had a look at the Win32 code : they are using DirectInput for all devices, which is quite bad as DirectInput is just a layer over Win32 ; DirectInput is even disadvised by Microsoft, except for Joysticks.
Quote from: "MSDN"
DirectInput is a set of API calls that abstracts input devices on the system. Internally, DirectInput creates a second thread to read WM_INPUT data, and using the DirectInput APIs will add more overhead than simply reading WM_INPUT directly. DirectInput is only useful for reading data from DirectInput joysticks; however, if you only need to support the Xbox 360 controller for Windows, then use XInput instead. Overall, using DirectInput offers no advantages when reading data from mouse or keyboard devices, and the use of DirectInput in these scenarios is discouraged.

http://msdn2.microsoft.com/en-us/library/bb206183.aspx

If I'd like to get more efficient inputs, I'd rather use more specific Win32 features, like raw inputs.

Concerning JOYINFOEX, I don't remember why I didn't use it ; I'll give it a try when I go back to the joysticks code.
Title: More Joystick Axis/Buttons
Post by: Srejv on September 05, 2007, 08:56:22 pm
I'm actually in the need of more analogs and buttons for my project :oops:
Title: More Joystick Axis/Buttons
Post by: Srejv on November 22, 2007, 09:15:32 pm
How is this part of sfml going?
Title: More Joystick Axis/Buttons
Post by: Laurent on November 23, 2007, 02:41:56 am
I still didn't work on this part, sorry.
Title: Re: More Joystick Axis/Buttons
Post by: obfusc8or on January 12, 2017, 11:47:34 am
Hello, I'm new on this forum. Sorry if I unnecessarily bumped this thread.

This stuff is exactly the reason I joined this forum. Specifically, I'd like SFML to support more joystick axes. Joystick.hpp (http://www.sfml-dev.org/documentation/2.4.1/Joystick_8hpp_source.php) defines an enum sf::Joystick::Axis (http://www.sfml-dev.org/documentation/2.4.1/classsf_1_1Joystick.php#a48db337092c2e263774f94de6d50baa7) that has 8 defined values. I think it would make more sense to address the axes by integers. Some game controllers, such as modern PlayStation gamepads, have axes for accelerometer and every button. A couple of tens of axes.

The restriction on the number of axes in SFML is the only reason that comes to my mind why I could prefer using SDL rather than SFML in a C++ 3D game.