[MPlayer-dev-eng] [PATCH] joystick double events and keydown/keyup for axes
Mark Pustjens
pustjens at dds.nl
Fri Jan 14 14:04:25 CET 2005
Hi everyone,
First let me say i'm sorry about not reading DOCS/tech/patches.txt. I hope
this is correct.
I recently bought a new gamepad, which has very sensitive axes. This
caused some problems with mplayer, in the way that it fired key-down
events much too soon. Just lightly touching the stick would couse an
event.
That is why i changed the default sensitivity using a hysteresis. The
hysteresis upper and lower bound should be configurable using a
commandline option, but i haven't taken the effort of finding out how i
should add this.
Also, the joystick input routines sends events for keyup and keydown
events of joystick axes. This causes problems if you want to use an axis
as a button. Bindings for axes are executed twice, once for keydown, and
once for keyup.
Take for example a binding an axis with the `pause' command. First it
pauses, and as soon as you return the stick to the center, the playback is
unpaused.
If have fixed this behavior. Bindings are now only executed for keydown
events. This fix does not break the autorepeat functionality.
I also added defines for 2 extra buttons, as my joypad has more than ten.
I have tested the patch using an usb joypad and a gameport gamepad. Both
worked for me.
If you can, please test this patch and give some comments on the code
changes.
I have attached the patch to this message.
--
He had the look of a lawn mower just after the grass had organised a
workers' collective. There was a definite suggestion that, deep inside, he
knew this was not really happening. It could not be happening because this
sort of thing did not happen. Any contradictory evidence could be safely
ignored.
(Jingo)
More information about the MPlayer-dev-eng
mailing list