mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
udev_joypad: make rumble work
Rumble was not working for me. I learnt a bit about how evdev works and it seems like you need to set a replay which defines how long the effect is (previously we set it to 0). This means there's a maximum length to the rumble effect which feels wrong. When we do `play.value = !!strength;` we're setting the number of times for the effect to repeat, which works fine because the effect stops when we set it to 0. It doesn't feel quite right to me playing e.g. Goldeneye but I've not played on real hardware for a while. I'm hoping someone is more familiar with evdev and can suggest a better approach.
This commit is contained in:
parent
b0de18ea12
commit
0bdf574cfd
@ -386,9 +386,16 @@ static bool udev_set_rumble(unsigned i,
|
||||
{
|
||||
/* Create new or update old playing state. */
|
||||
struct ff_effect e = {0};
|
||||
/* This defines the length of the effect and
|
||||
the delay before playing it. This means there
|
||||
is a limit on the maximum vibration time, but
|
||||
it's hopefully sufficient for most cases. Maybe
|
||||
there's a better way? */
|
||||
struct ff_replay replay = {0xffff, 0};
|
||||
|
||||
e.type = FF_RUMBLE;
|
||||
e.id = old_effect;
|
||||
e.replay = replay;
|
||||
|
||||
switch (effect)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user