Prevent the accelerometer from being mapped to controls directly until we can create sane UI for that.

This commit is contained in:
Henrik Rydgard 2014-01-06 23:58:59 +01:00
parent ad951bc0d4
commit 5f2954bc69

View file

@ -264,6 +264,16 @@ void KeyMappingNewKeyDialog::key(const KeyInput &key) {
}
void KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
// Ignore the accelerometer for mapping for now.
switch (axis.axisId) {
case JOYSTICK_AXIS_ACCELEROMETER_X:
case JOYSTICK_AXIS_ACCELEROMETER_Y:
case JOYSTICK_AXIS_ACCELEROMETER_Z:
return;
default:
;
}
if (axis.value > AXIS_BIND_THRESHOLD) {
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, 1));
screenManager()->finishDialog(this, DR_OK);