Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Dec 14, 2023
1 parent 88b1943 commit b941f40
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions UI/ControlMappingScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,25 +413,9 @@ bool KeyMappingNewMouseKeyDialog::key(const KeyInput &key) {
return true;
}

static bool IgnoreAxisForMapping(int axis) {
switch (axis) {
case JOYSTICK_AXIS_ACCELEROMETER_X:
case JOYSTICK_AXIS_ACCELEROMETER_Y:
case JOYSTICK_AXIS_ACCELEROMETER_Z:
// Ignore the accelerometer for mapping for now.
// We use tilt control for these.
return true;

default:
return false;
}
}

void KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
if (time_now_d() < delayUntil_)
return;
if (IgnoreAxisForMapping(axis.axisId))
return;
if (ignoreInput_)
return;

Expand Down Expand Up @@ -468,8 +452,6 @@ void KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
void KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) {
if (mapped_)
return;
if (IgnoreAxisForMapping(axis.axisId))
return;

if (axis.value > AXIS_BIND_THRESHOLD) {
mapped_ = true;
Expand Down Expand Up @@ -698,10 +680,6 @@ bool TouchTestScreen::key(const KeyInput &key) {
}

void TouchTestScreen::axis(const AxisInput &axis) {
// This just filters out accelerometer events. We show everything else.
if (IgnoreAxisForMapping(axis.axisId))
return;

char buf[512];
snprintf(buf, sizeof(buf), "Axis: %s (%d) (value %1.3f) Device ID: %d",
KeyMap::GetAxisName(axis.axisId).c_str(), axis.axisId, axis.value, axis.deviceId);
Expand Down

0 comments on commit b941f40

Please sign in to comment.