Skip to content

Commit

Permalink
feat: added support for dualshock controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Dec 1, 2024
1 parent b00a225 commit e3f6f21
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/engine/utilities/input_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void input::input_manager::input_loop() {
const char *name = glfwGetJoystickName(GLFW_JOYSTICK_1);

// Is the controller a Playstation Controller?
if (std::string(name).find("DualSense") == 0) {
if (std::string(name).find("DualSense") == 0 || std::string(name).find("DualShock") == 0) {
current_controller_type = PLAYSTATION;
} else {
// Default to XBOX if we can't find "DualSense".
Expand All @@ -75,7 +75,6 @@ void input::input_manager::input_loop() {
{
int count;

// Luckily, controller axis input on Playstation isn't any different to Xbox.
const float *axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &count);

const float x_axis = axes[0];
Expand Down

0 comments on commit e3f6f21

Please sign in to comment.