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

Function QueryProfileCode

engine/Poseidon/Input/InputSubsystem.cpp:349–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349static float QueryProfileCode(const Input& in, InputCode code, bool checkFocus)
350{
351 if (!code.valid())
352 return 0.0f;
353 const int packed = code.toLegacy();
354 const int value = InputBindingValue(packed);
355 switch (InputBindingDevice(packed))
356 {
357 case INPUT_DEVICE_KEYBOARD:
358 return InputBindingIsDoubleTap(packed) ? QueryDoubleTapKey(in, value, checkFocus)
359 : QueryKey(in, value, checkFocus);
360 case INPUT_DEVICE_MOUSE:
361 return InputBindingIsDoubleTap(packed) ? QueryDoubleTapMouseButton(in, value, checkFocus)
362 : QueryMouseButton(in, value, checkFocus);
363 case INPUT_DEVICE_STICK:
364 return QueryJoystickButton(in, value, checkFocus);
365 case INPUT_DEVICE_STICK_AXIS:
366 return value >= 0 && value < N_JOYSTICK_AXES ? in.gamepad.stickAxis[value] : 0.0f;
367 case INPUT_DEVICE_STICK_POV:
368 return value >= 0 && value < N_JOYSTICK_POV && in.gamepad.stickPov[value] ? 1.0f : 0.0f;
369 default:
370 return 0.0f;
371 }
372}
373
374static bool QueryProfileCodeToDo(Input& in, InputCode code, bool reset, bool checkFocus)
375{

Callers 1

QueryProfileActionFunction · 0.85

Calls 10

InputBindingValueFunction · 0.85
InputBindingDeviceFunction · 0.85
InputBindingIsDoubleTapFunction · 0.85
QueryDoubleTapKeyFunction · 0.85
QueryKeyFunction · 0.85
QueryMouseButtonFunction · 0.85
QueryJoystickButtonFunction · 0.85
toLegacyMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected