Enum instead of bool

For the “Gamepad Active” variable, the code assumes that only gamepad and keyboard/mouse will be used. Unreal however supports tons of other inputs (various VR controllers, Steam’s special inputs, …). It would be better to:

  • Use an enumeration to indicate if it’s one or the other with switch statements so the code can easily be extended later for other inputs
  • Check explicitly if for keyboard/mouse instead of assuming if it’s a not gamepad key, it must be a keyboard/mouse (i.e. leave the variable unchanged if it’s any other input types)

1 Like

Privacy & Terms