• Raphael Assenat's avatar
    Input: joydev - do not report stale values on first open · 45536d37
    Raphael Assenat authored
    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: default avatarRaphael Assenat <raph@raphnet.net>
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    45536d37
joydev.c 24.1 KB