1 #ifndef MSP_INPUT_BINDINGS_H_
2 #define MSP_INPUT_BINDINGS_H_
4 #include <msp/datafile/objectloader.h>
5 #include <msp/strings/lexicalcast.h>
18 class Loader: public DataFile::ObjectLoader<Bindings>
21 static ActionMap shared_actions;
27 virtual void init_actions();
29 void binding(const std::string &);
30 void device_type(DeviceType);
31 void device_name(const std::string &);
36 DeviceType type = UNSPECIFIED;
47 friend void operator>>(const LexicalConverter &, AxisSide &);
48 friend void operator<<(LexicalConverter &, AxisSide);
53 class Loader: public DataFile::ObjectLoader<Binding>
56 static ActionMap shared_actions;
62 virtual void init_actions();
64 void axis(unsigned, AxisSide);
65 void button(unsigned);
66 void key(Key k) { button(k); }
76 std::vector<DeviceRef> devices;
77 std::vector<Binding> bindings;
80 const std::vector<DeviceRef> &get_devices() const { return devices; }
81 std::vector<Device *> resolve_devices(Device &) const;
82 bool is_compatible(Device &) const;
83 const std::vector<Binding> &get_bindings() const { return bindings; }
85 bool apply_to(ControlScheme &, Device &);