Distributed under the LGPL
*/
+#include <msp/strings/formatter.h>
#include "inputdevice.h"
namespace Msp {
namespace Input {
-bool Device::get_button_state(unsigned btn)
+bool Device::get_button_state(unsigned btn) const
{
if(btn>buttons.size())
return false;
return buttons[btn];
}
-float Device::get_axis_value(unsigned axis)
+float Device::get_axis_value(unsigned axis) const
{
if(axis>axes.size())
return 0;
return axes[axis];
}
+std::string Device::get_button_name(unsigned btn) const
+{
+ return format("Button %d", btn);
+}
+
+std::string Device::get_axis_name(unsigned axis) const
+{
+ return format("Axis %d", axis);
+}
+
void Device::set_button_state(unsigned btn, bool state, bool event)
{
if(btn>=buttons.size())