Files
OpenVulkano/openVulkanoCpp/Input/InputAction.hpp
2023-10-12 12:13:14 +02:00

43 lines
936 B
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "BaseInputAction.hpp"
#include "InputKey.hpp"
namespace OpenVulkano::Input
{
class InputAction final : public BaseInputAction
{
std::vector<InputKey> keys;
std::vector<std::pair<InputKey, InputKey>> axisButtons;
public:
InputAction(const std::string& name) : BaseInputAction(name)
{}
[[nodiscard]] const std::vector<InputKey>& GetKeys() const
{
return keys;
}
[[nodiscard]] const std::vector<std::pair<InputKey, InputKey>>& GetAxisButtons() const
{
return axisButtons;
}
void BindKey(InputKey key)
{
keys.push_back(key);
}
void BindAxisButtons(InputKey keyPositive, InputKey keyNegative)
{
axisButtons.emplace_back(keyPositive, keyNegative);
}
};
}