Distributed under the LGPL
*/
+#include <msp/strings/formatter.h>
#include "mouse.h"
namespace Msp {
window(w),
axis_scale(0.01)
{
+ name="Mouse";
+
buttons.resize(3);
axes.resize(2);
window.signal_pointer_motion.connect(sigc::mem_fun(this, &Mouse::pointer_motion));
}
+std::string Mouse::get_button_name(unsigned btn) const
+{
+ switch(btn)
+ {
+ case 1:
+ return "Left";
+ case 2:
+ return "Middle";
+ case 3:
+ return "Right";
+ case 4:
+ return "Wheel Up";
+ case 5:
+ return "Wheel Down";
+ default:
+ return format("Button %d", btn);
+ }
+}
+
void Mouse::button_press(int, int, unsigned btn, unsigned)
{
set_button_state(btn, true, true);