Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: More Joystick Axis/Buttons  (Read 18039 times)

0 Members and 1 Guest are viewing this topic.

ExcessNeo

  • Newbie
  • *
  • Posts: 16
    • View Profile
More Joystick Axis/Buttons
« on: August 14, 2007, 05:49:53 am »
A suggestion for a future release.

    Support for a higher range of Buttons for those with more advanced joysticks
    Support for a higher number of Axis for those with more advanced joysticks/joy pads with two analogue sticks


Keep up the good work  :D

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
More Joystick Axis/Buttons
« Reply #1 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 ;)
Laurent Gomila - SFML developer

bibi.skuk

  • Guest
More Joystick Axis/Buttons
« Reply #2 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)

mweb

  • Newbie
  • *
  • Posts: 13
    • View Profile
More Joystick Axis/Buttons
« Reply #3 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
More Joystick Axis/Buttons
« Reply #4 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.
Laurent Gomila - SFML developer

Srejv

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
More Joystick Axis/Buttons
« Reply #5 on: September 05, 2007, 08:56:22 pm »
I'm actually in the need of more analogs and buttons for my project :oops:

Srejv

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
More Joystick Axis/Buttons
« Reply #6 on: November 22, 2007, 09:15:32 pm »
How is this part of sfml going?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
More Joystick Axis/Buttons
« Reply #7 on: November 23, 2007, 02:41:56 am »
I still didn't work on this part, sorry.
Laurent Gomila - SFML developer

obfusc8or

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: More Joystick Axis/Buttons
« Reply #8 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 defines an enum sf::Joystick::Axis 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.