support more axes
This commit is contained in:
@@ -58,8 +58,12 @@ CString DeviceInput::GetDescription()
|
||||
case JOY_DOWN: sReturn += "Down"; break;
|
||||
case JOY_Z_UP: sReturn += "Z-Up"; break;
|
||||
case JOY_Z_DOWN: sReturn += "Z-Down"; break;
|
||||
case JOY_Z_ROT_UP: sReturn += "ZR-Up"; break;
|
||||
case JOY_Z_ROT_DOWN:sReturn += "ZR-Down"; break;
|
||||
case JOY_ROT_UP: sReturn += "R-Up"; break;
|
||||
case JOY_ROT_DOWN:sReturn += "R-Down"; break;
|
||||
case JOY_ROT_LEFT: sReturn += "R-Left"; break;
|
||||
case JOY_ROT_RIGHT:sReturn += "R-Right"; break;
|
||||
case JOY_ROT_Z_UP: sReturn += "ZR-Up"; break;
|
||||
case JOY_ROT_Z_DOWN:sReturn += "ZR-Down"; break;
|
||||
case JOY_HAT_LEFT: sReturn += "H-Left"; break;
|
||||
case JOY_HAT_RIGHT: sReturn += "H-Right"; break;
|
||||
case JOY_HAT_UP: sReturn += "H-Up"; break;
|
||||
|
||||
@@ -28,7 +28,7 @@ enum JoystickButton {
|
||||
JOY_LEFT = 0, JOY_RIGHT,
|
||||
JOY_UP, JOY_DOWN,
|
||||
JOY_Z_UP, JOY_Z_DOWN,
|
||||
JOY_Z_ROT_UP, JOY_Z_ROT_DOWN,
|
||||
JOY_ROT_UP, JOY_ROT_DOWN, JOY_ROT_LEFT, JOY_ROT_RIGHT, JOY_ROT_Z_UP, JOY_ROT_Z_DOWN,
|
||||
JOY_HAT_LEFT, JOY_HAT_RIGHT, JOY_HAT_UP, JOY_HAT_DOWN,
|
||||
JOY_1, JOY_2, JOY_3, JOY_4, JOY_5, JOY_6, JOY_7, JOY_8, JOY_9, JOY_10,
|
||||
JOY_11, JOY_12, JOY_13, JOY_14, JOY_15, JOY_16, JOY_17, JOY_18, JOY_19, JOY_20,
|
||||
|
||||
@@ -159,10 +159,12 @@ void ScreenMapControllers::Input( const DeviceInput& DeviceI, const InputEventTy
|
||||
DeviceI.button == JOY_RIGHT ||
|
||||
DeviceI.button == JOY_UP ||
|
||||
DeviceI.button == JOY_DOWN ||
|
||||
DeviceI.button == JOY_Z_UP ||
|
||||
DeviceI.button == JOY_Z_DOWN ||
|
||||
DeviceI.button == JOY_Z_ROT_UP ||
|
||||
DeviceI.button == JOY_Z_ROT_DOWN ) )
|
||||
DeviceI.button == JOY_ROT_UP ||
|
||||
DeviceI.button == JOY_ROT_DOWN ||
|
||||
DeviceI.button == JOY_ROT_LEFT ||
|
||||
DeviceI.button == JOY_ROT_RIGHT ||
|
||||
DeviceI.button == JOY_ROT_Z_UP ||
|
||||
DeviceI.button == JOY_ROT_Z_DOWN ) )
|
||||
{
|
||||
//m_textError.SetText( "Game option is set to ignore the Joystick D-Pad." );
|
||||
//m_fErrorDisplayCountdown = 5; // show the error message
|
||||
|
||||
@@ -516,8 +516,14 @@ void UpdatePolled(DIDevice &device)
|
||||
case DIJOFS_Z: INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_Z_UP), state.lZ < -50);
|
||||
INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_Z_DOWN), state.lZ > 50);
|
||||
break;
|
||||
case DIJOFS_RZ: INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_Z_ROT_UP), state.lRz < -50);
|
||||
INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_Z_ROT_DOWN), state.lRz > 50);
|
||||
case DIJOFS_RX: INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_ROT_LEFT), state.lRx < -50);
|
||||
INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_ROT_RIGHT), state.lRx > 50);
|
||||
break;
|
||||
case DIJOFS_RY: INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_ROT_UP), state.lRy < -50);
|
||||
INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_ROT_DOWN), state.lRy > 50);
|
||||
break;
|
||||
case DIJOFS_RZ: INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_ROT_Z_UP), state.lRz < -50);
|
||||
INPUTFILTER->ButtonPressed(DeviceInput(dev, JOY_ROT_Z_DOWN), state.lRz > 50);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -595,7 +601,9 @@ void UpdateBuffered(DIDevice &device)
|
||||
case DIJOFS_X: up = JOY_LEFT; down = JOY_RIGHT; break;
|
||||
case DIJOFS_Y: up = JOY_UP; down = JOY_DOWN; break;
|
||||
case DIJOFS_Z: up = JOY_Z_UP; down = JOY_Z_DOWN; break;
|
||||
case DIJOFS_RZ: up = JOY_Z_ROT_UP; down = JOY_Z_ROT_DOWN; break;
|
||||
case DIJOFS_RX: up = JOY_ROT_UP; down = JOY_ROT_DOWN; break;
|
||||
case DIJOFS_RY: up = JOY_ROT_LEFT; down = JOY_ROT_RIGHT; break;
|
||||
case DIJOFS_RZ: up = JOY_ROT_Z_UP; down = JOY_ROT_Z_DOWN; break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user