brought back functionality from previous builds but now cross-platform

This commit is contained in:
2025-07-07 15:34:34 +03:00
parent 99eafb9443
commit 83bc9b7f16
61 changed files with 1210 additions and 581 deletions

View File

@@ -6,7 +6,9 @@
char g_PressedKeys[KEY_NUM_KEYS];
float g_fAxisValues[AXIS_NUM_AXIS];
float g_fAxisModifiers[AXIS_NUM_AXIS];
CUtlString g_bindings[256];
bool g_bController = false;
struct KeyName_t {
const char *szName;
@@ -17,7 +19,22 @@ KeyName_t keys[] = {
{"TAB",KEY_TAB},
{"ENTER",KEY_ENTER},
{"ESCAPE",KEY_ESCAPE},
{"ESC",KEY_ESCAPE},
{"SPACE",KEY_SPACE},
{"F1",KEY_F1},
{"F2",KEY_F2},
{"F3",KEY_F3},
{"F4",KEY_F4},
{"F5",KEY_F5},
{"F6",KEY_F6},
{"F7",KEY_F7},
{"F8",KEY_F8},
{"F9",KEY_F9},
{"F10",KEY_F10},
{"F11",KEY_F11},
{"F12",KEY_F12},
{"A",KEY_A},
{"B",KEY_B},
{"C",KEY_C},
@@ -105,8 +122,14 @@ void IInput::AxisEvent( EInputAxis axis, float fValue )
{
if (axis == AXIS_MOUSE_X || axis == AXIS_MOUSE_Y)
{
g_bController = false;
g_fAxisValues[axis] += fValue*3.09;
}
if (axis == AXIS_CONTROLLER_PITCH || axis == AXIS_CONTROLLER_YAW)
{
g_bController = true;
g_fAxisModifiers[axis] = fValue*3.09;
}
}
//-----------------------------------------------------------------------------
@@ -114,7 +137,8 @@ void IInput::AxisEvent( EInputAxis axis, float fValue )
//-----------------------------------------------------------------------------
void IInput::Frame( void )
{
g_fAxisValues[AXIS_MOUSE_X] += g_fAxisModifiers[AXIS_CONTROLLER_PITCH];
g_fAxisValues[AXIS_MOUSE_Y] += g_fAxisModifiers[AXIS_CONTROLLER_YAW];
}
//-----------------------------------------------------------------------------