MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ProfileModifierHeld

Function ProfileModifierHeld

engine/Poseidon/Input/InputSubsystem.cpp:326–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326static bool ProfileModifierHeld(const Input& in, InputCode modifier, bool checkFocus)
327{
328 if (!modifier.valid())
329 return true;
330 const int packed = modifier.toLegacy();
331 const int value = InputBindingValue(packed);
332 switch (InputBindingDevice(packed))
333 {
334 case INPUT_DEVICE_KEYBOARD:
335 return QueryKey(in, value, checkFocus) > 0.0f;
336 case INPUT_DEVICE_MOUSE:
337 return QueryMouseButton(in, value, checkFocus) > 0.0f;
338 case INPUT_DEVICE_STICK:
339 return QueryJoystickButton(in, value, checkFocus) > 0.0f;
340 case INPUT_DEVICE_STICK_AXIS:
341 return value >= 0 && value < N_JOYSTICK_AXES && std::fabs(in.gamepad.stickAxis[value]) > 0.8f;
342 case INPUT_DEVICE_STICK_POV:
343 return value >= 0 && value < N_JOYSTICK_POV && in.gamepad.stickPov[value];
344 default:
345 return false;
346 }
347}
348
349static float QueryProfileCode(const Input& in, InputCode code, bool checkFocus)
350{

Callers 2

QueryProfileActionFunction · 0.85
QueryProfileActionToDoFunction · 0.85

Calls 8

InputBindingValueFunction · 0.85
InputBindingDeviceFunction · 0.85
QueryKeyFunction · 0.85
QueryMouseButtonFunction · 0.85
QueryJoystickButtonFunction · 0.85
fabsFunction · 0.85
toLegacyMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected