I am making a C++ SDL based game engine, currently doing the InputManager, check my class and make the necessary fixes, things I know are wrong:

class InputManager
{
    public:
        ~InputManager();
        InputManager(const InputManager&) = delete;
        InputManager operator=(const InputManager&) = delete;
        static InputManager& GetInstance();
        void Update();
        bool IsKeyPressed(Input::KeyCode key) const;
        bool IsKeyReleased(Input::KeyCode key) const;
        bool IsMouseButtonPressed(Input::MouseButton button) const;
        Point GetMousePosition() const;
        bool IsGamepadButtonPressed(Input::GamepadButton button, int gamepadIndex) const;
        bool IsGamepadButtonReleased(Input::GamepadButton button, int gamepadIndex) const;

    private:
        InputManager();
        void UpdateKeyboardState();
        void UpdateGamepadState();
        void SetMouseState(uint8_t mouseButton, bool pressed);
        SDL_GameController* GetGamepad(int index);
        void GamepadButtonPressed(uint8_t button, int gamepadIndex);
        void GamepadButtonReleased(uint8_t button, int gamepadIndex);

        std::unordered_map<Input::KeyCode, bool> currentKeyboardState;
        std::unordered_map<Input::KeyCode, bool> previousKeyboardState;
        std::unordered_map<Input::MouseButton, bool> mouseButtonsState;
        std::vector<SDL_GameController*> gamepads;
        std::vector<std::unordered_map<Input::GamepadButton, bool>> currentGamepadState;
        std::vector<std::unordered_map<Input::GamepadButton, bool>> previousGamepadState;
};

uint8_t KeyToSDL(Input::KeyCode keyCode);
Input::KeyCode KeyFromSDL(uint8_t sdlKeyCode);
uint8_t MouseButtonToSDL(Input::MouseButton mouseButton);
Input::MouseButton MouseButtonFromSDL(uint8_t sdlMouseButton);
SDL_GameControllerButton GamepadButtonToSDL(Input::GamepadButton gamepadButton);
Input::GamepadButton GamepadButtonFromSDL(SDL_GameControllerButton sdlGamepadButton);

InputManager::InputManager()
{
}

InputManager::~InputManager()
{
    for (SDL_GameController* gamepad : gamepads)
    {
        if (gamepad)
        {
            SDL_GameControllerClose(gamepad);
        }
    }
}

InputManager& InputManager::GetInstance()
{
    static InputManager instance;

    return instance;
}

void InputManager::Update()
{
    previousKeyboardState = currentKeyboardState;

    SDL_Event event;
    while (SDL_PollEvent(&event))
    {
        switch (event.type)
        {
            case SDL_MOUSEBUTTONUP:
                {
                    SetMouseState(event.button.button, false);
                    break;
                }
            case SDL_MOUSEBUTTONDOWN:
                {
                    SetMouseState(event.button.button, true);
                    break;
                }
            case SDL_CONTROLLERDEVICEADDED:
                {
                    int index = event.cdevice.which;
                    if (index < static_cast<int>(gamepads.size()) && !gamepads[index])
                    {
                        gamepads[index] = SDL_GameControllerOpen(index);
                    }
                    else if (index >= static_cast<int>(gamepads.size()))
                    {
                        gamepads.resize(index + 1);
                        gamepads[index] = SDL_GameControllerOpen(index);
                    }
                    break;
                }
            case SDL_CONTROLLERDEVICEREMOVED:
                {
                    int index = event.cdevice.which;
                    if (index < static_cast<int>(gamepads.size()) && gamepads[index])
                    {
                        SDL_GameControllerClose(gamepads[index]);
                        gamepads[index] = nullptr;
                    }
                    break;
                }
            case SDL_CONTROLLERBUTTONDOWN:
                {
                    GamepadButtonPressed(event.cbutton.button, event.cbutton.which);
                    break;
                }
            case SDL_CONTROLLERBUTTONUP:
                {
                    GamepadButtonReleased(event.cbutton.button, event.cbutton.which);
                    break;
                }
        }
    }

    UpdateKeyboardState();
}

bool InputManager::IsKeyPressed(Input::KeyCode key) const
{
    auto currentState = currentKeyboardState.find(key);
    auto previousState = previousKeyboardState.find(key);

    return (currentState != currentKeyboardState.end() && currentState->second) && (previousState == previousKeyboardState.end() || !previousState->second);
}

bool InputManager::IsKeyReleased(Input::KeyCode key) const
{
    auto currentState = currentKeyboardState.find(key);
    auto previousState = previousKeyboardState.find(key);

    return (previousState != previousKeyboardState.end() && previousState->second) && (currentState == currentKeyboardState.end() || !currentState->second);
}

bool InputManager::IsMouseButtonPressed(Input::MouseButton button) const
{
    auto mouseState = mouseButtonsState.find(button);

    return (mouseState != mouseButtonsState.end() && mouseState->second);
}

Point InputManager::GetMousePosition() const
{
    int x = 0;
    int y = 0;
    SDL_GetMouseState(&x, &y);

    return Point(x, y);
}

bool InputManager::IsGamepadButtonPressed(Input::GamepadButton button, int gamepadIndex) const
{
    auto currentState = currentGamepadState[gamepadIndex].find(button);
    auto previousState = previousGamepadState[gamepadIndex].find(button);

    return (previousState != previousGamepadState[gamepadIndex].end() && previousState->second) && (currentState == currentGamepadState[gamepadIndex].end() || !currentState->second);
}

bool InputManager::IsGamepadButtonReleased(Input::GamepadButton button, int gamepadIndex) const
{
    auto currentState = currentGamepadState[gamepadIndex].find(button);
    auto previousState = previousGamepadState[gamepadIndex].find(button);

    return (previousState != previousGamepadState[gamepadIndex].end() && previousState->second) && (currentState == currentGamepadState[gamepadIndex].end() || !currentState->second);
}

void InputManager::SetMouseState(uint8_t mouseButton, bool pressed)
{
    mouseButtonsState[MouseButtonFromSDL(mouseButton)] = pressed;
}

void InputManager::UpdateKeyboardState()
{
    int numKeys;
    const Uint8* keyStates = SDL_GetKeyboardState(&numKeys);

    for (int i = 0; i < numKeys; ++i)
    {
        Input::KeyCode code = KeyFromSDL(i);

        currentKeyboardState[code] = keyStates[i] != 0;
    }
}

SDL_GameController* InputManager::GetGamepad(int index)
{
    if (index < static_cast<int>(gamepads.size()))
    {
        return gamepads[index];
    }
    return nullptr;
}

void InputManager::GamepadButtonPressed(uint8_t button, int gamepadIndex)
{
    Input::GamepadButton gamepadButton = GamepadButtonFromSDL(static_cast<SDL_GameControllerButton>(button));
    previousGamepadState[gamepadIndex][gamepadButton] = currentGamepadState[gamepadIndex][gamepadButton];
    currentGamepadState[gamepadIndex][gamepadButton] = true;
}

void InputManager::GamepadButtonReleased(uint8_t button, int gamepadIndex)
{
    Input::GamepadButton gamepadButton = GamepadButtonFromSDL(static_cast<SDL_GameControllerButton>(button));
    previousGamepadState[gamepadIndex][gamepadButton] = currentGamepadState[gamepadIndex][gamepadButton];
    currentGamepadState[gamepadIndex][gamepadButton] = false;
}