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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CastleDefender

Pages: [1]
1
Window / Re: Joystick vibration
« on: April 18, 2013, 10:44:53 pm »
After reading an interesting post from this blog: http://blog.robothaus.org/2011/12/09/gamepad-vibration-zero-to-hero/, I managed  to make my X-Box 360 controller vibrate from the terminal!

Here's what I did for those who are interested:

1) I installed the "joystick" package on my Ubuntu 12.04
Quote
sudo apt-get install joystick

2)Find on which input is the joystick connected to:
Quote
dmesg | grep X-Box
[ 9191.142998] input: Microsoft X-Box 360 pad as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/input/input22

3)Run fftest on the corresponding event (22 in my case).
(Warning  you might need to use sudo for this, but I didn't)
Quote
fftest /dev/input/event22
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/event22 opened
Axes query:
Effects: Periodic Rumble
Number of simultaneous effects: 16
Upload effects[1]: Invalid argument
Upload effects[2]: Invalid argument
Upload effects[3]: Invalid argument
Enter effect number, -1 to exit

4) Try some effects (up to 16 apparently)
In my case only effect 4 (strong rumble) and effect 5 (weak rumble) worked.

This is good news, even if I'm still far from having joystick vibration in the game, now I know it's possible! Now I need to see if I can make the joystick vibrate from C++ without doing system calls!

Nick


2
Window / Joystick vibration
« on: April 18, 2013, 11:51:30 am »
Hello everyone,

I'm a recent user of SFML (2.0 RC), I started using it mainly for the sound module in order to add some music and sounds in my game (http://castledefenderdevdiary.blogspot.co.uk/). But the rest of sfml seems pretty good too, so I might switch all my code from glfw to SFML.

I'm interested in the sf::Joystick class, it doesn't seem to have any option for joystick vibration right now, but will this feature be one day part of SFML?

If it isn't planned, do you have any advice on how to implement joystick vibration/rumble in C++? I'm using Xbox360  Controllers on Linux.
And if I manage to get it working, then maybe we can talk about adding the functionality to the next version of sfml.

Regards,
Nick


Pages: [1]