3 This file is part of libmspgbase
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #include "inputdevice.h"
13 bool Device::get_button_state(unsigned btn) const
15 if(btn>buttons.size())
21 float Device::get_axis_value(unsigned axis) const
29 void Device::set_button_state(unsigned btn, bool state, bool event)
31 if(btn>=buttons.size())
32 buttons.resize(btn+1, false);
34 if(state!=buttons[btn])
41 signal_button_press.emit(btn);
43 signal_button_release.emit(btn);
48 void Device::set_axis_value(unsigned axis, float value, bool event)
51 axes.resize(axis+1, 0);
59 signal_axis_motion.emit(axis, value, value-old);