Okay, the SDL input driver changing display preferences finally got to

me, so I'm cleaning it up.

Add "level" parameter to DeviceInput, indicating the degree the axis
or button is depressed.  If it's < 0, it's not an analog input; otherwise,
IET_LEVEL_CHANGED events will come in when the level changes.

Add secondary stick axis inputs, so there's a correct place to put them.

Handle these inputs in ScreenCenterImage.  Inputs mapped to gameplay
inputs are always a primary input; otherwise, the first stick is translate
and the secondary is scale.  Input is analog when possible; holding shift
reverses the map, so keyboard input works roughly the same as before.

Do away with the special Xbox-specific centering code; use the standard
centering matrix.  If this doesn't work, any special cases to fix it should be
hidden away in RageDisplay_D3D.

The input maps are likely to work on the Xbox as is, since the SDL driver
maps axes in order, but I can't test it.

This won't work with PS2 converters, since #1: those things map the
secondary axis to seemingly random places (on mine, JOY_Z_UP,
JOY_Z_DOWN, JOY_ROT_Z_UP, JOY_ROT_Z_DOWN), and #2: they
don't identify themselves uniquely.  Unless there's a pattern in how they're
mapping that I can't see (since I don't have many converters), this just
can't be done reliably.  (No big deal; PCs have keyboards.)
This commit is contained in:
Glenn Maynard
2004-09-09 22:10:21 +00:00
parent 5355a5934b
commit a643146a54
2 changed files with 29 additions and 11 deletions
+4 -3
View File
@@ -58,6 +58,10 @@ CString DeviceInput::GetDescription()
case JOY_RIGHT: sReturn += "Right"; break;
case JOY_UP: sReturn += "Up"; break;
case JOY_DOWN: sReturn += "Down"; break;
case JOY_LEFT_2: sReturn += "Left2"; break;
case JOY_RIGHT_2: sReturn += "Right2"; break;
case JOY_UP_2: sReturn += "Up2"; break;
case JOY_DOWN_2: sReturn += "Down2"; break;
case JOY_Z_UP: sReturn += "Z-Up"; break;
case JOY_Z_DOWN: sReturn += "Z-Down"; break;
case JOY_ROT_UP: sReturn += "R-Up"; break;
@@ -260,9 +264,6 @@ char DeviceInput::ToChar() const
case DEVICE_KEYBOARD:
if( button < 128 )
return (char) button;
/* XXX: SDLK_WORLD_* are for international keyboards; we can handle those,
* now, by mapping it to Unicode. However, I can't find any documentation
* on those keysyms. */
return '\0';
default:
return '\0';