Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
No Matches
KODI::JOYSTICK::CDeadzoneFilter Class Reference

Analog axis deadzone filtering. More...

#include <DeadzoneFilter.h>

Public Member Functions

 CDeadzoneFilter (IButtonMap *buttonMap, PERIPHERALS::CPeripheral *peripheral)
float FilterAxis (unsigned int axisIndex, float axisValue)
 Apply deadzone filtering to an axis.

Detailed Description

Analog axis deadzone filtering.

Axis is scaled appropriately, so position is continuous from -1.0 to 1.0:

       |    / 1.0
       |   /
    /  |
   /   |--| Deadzone

-1.0 / |

After deadzone filtering, the value will be:

  • Negative in the interval [-1.0, -deadzone)
  • Zero in the interval [-deadzone, deadzone]
  • Positive in the interval (deadzone, 1.0]

Constructor & Destructor Documentation

◆ CDeadzoneFilter()

CDeadzoneFilter::CDeadzoneFilter ( IButtonMap * buttonMap,
PERIPHERALS::CPeripheral * peripheral )

Member Function Documentation

◆ FilterAxis()

float CDeadzoneFilter::FilterAxis ( unsigned int axisIndex,
float axisValue )

Apply deadzone filtering to an axis.

axisIndexThe axis index
axisValueThe axis value
The value after applying deadzone filtering

The documentation for this class was generated from the following files: