Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/input/device_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class DeviceConfig : public NoCopy
virtual bool load(const XMLNode *config);

// ------------------------------------------------------------------------
/** Returns true if this device has an analog axis. */
/** Returns true if this device has analog axis, so that steering values
* will not be affected by time-full-steer delays. */
virtual bool isAnalog(Input::InputType type, int id) const { return false;}
// ------------------------------------------------------------------------
/** Returns true if this device should desensitize its input at values
Expand Down
12 changes: 12 additions & 0 deletions src/input/gamepad_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ bool GamePadDevice::processAndMapInput(Input::InputType type, const int id,
{
if (!m_configuration->isEnabled()) return false;

// A digital input value is 32767 or -32768 (which then triggers
// time-full-steer to be used to adjust actual steering values.
// To prevent this delay for analog gamesticks, make sure that
// 32767/-32768 are never used.
if(m_configuration->isAnalog(type, id))
{
if(*value==32767)
*value = 32766;
else if(*value==-32768)
*value = -32767;
}

// Desensitizing means to map an input in the range x in [0,1] to
// x^2. This results in changes close to 0 to have less impact
// (less sensitive).
Expand Down
Loading