]> git.baikalelectronics.ru Git - kernel.git/commit
Input: joydev - do not report stale values on first open
authorRaphael Assenat <raph@raphnet.net>
Thu, 29 Dec 2016 18:23:09 +0000 (10:23 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 9 Feb 2017 21:29:04 +0000 (13:29 -0800)
commit093d3ee79b84f265451cd4c5ab8ec28a6fa121a2
treebc6f207b05a6626d616227a1951df01d7c7d766f
parent5aef229ea108a4a55107bfa76f5878392b3ee451
Input: joydev - do not report stale values on first open

Postpone axis initialization to the first open instead of doing it
in joydev_connect. This is to make sure the generated startup events
are representative of the current joystick state rather than what
it was when joydev_connect() was called, potentially much earlier.
Once the first user is connected to joydev node we'll be updating
joydev->abs[] values and subsequent clients will be getting correct
initial states as well.

This solves issues with joystick driven menus that start scrolling
up each time they are started, until the user moves the joystick to
generate events. In emulator menu setups where the menu program is
restarted every time the game exits, the repeated need to move the
joystick to stop the unintended scrolling gets old rather quickly...

Signed-off-by: Raphael Assenat <raph@raphnet.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joydev.c