Skip to content

joystick: initial state of throttle input is not detected #105676

@nbaum

Description

@nbaum

Tested versions

v4.5.dev.custom_build [689c503c5]

I believe this is present in all versions with joystick support.

System information

Godot v4.5.dev (689c503c5) - Arch Linux #1 SMP PREEMPT_DYNAMIC Mon, 07 Apr 2025 19:59:13 +0000 on X11 - X11 display driver, Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 (nvidia; 570.133.07) - AMD Ryzen 9 9950X 16-Core Processor (32 threads)

Issue description

Some joysticks have throttle controls - axis inputs which remain where you put them when you let go, rather than returning to a neutral position.

This means that when Godot starts up, it is quite reasonable for a throttle to actually be in a non-zero position. However, Godot does not know the position of the throttle until it actually moves.

On Linux, joysticks are accessed via the evdev interface at - typically - /dev/input/eventN. This interface does not provide a way to query the current state of the axes.

There is another interface at /dev/input/jsN which emits synthetic input events reflecting the current state of the axes when you open the device file.

Steps to reproduce

Having a joystick with a throttle, run print(Input.get_joy_axis(A, B) in a _process, where A and B are whatever's right for the throttle control. Until you move the throttle, it'll print 0.0, even if the throttle starts in a non-zero position.

Minimal reproduction project (MRP)

initial-throttle-state_2025-04-23_10-55-39.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions