]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/device.cpp
Add functions to look up subdevices of composite input devices
[libs/gui.git] / source / input / device.cpp
index 452af22543e4f57db85a9a5271dad5c2648c96a1..d5b3b864af3c854d42de216196ab42a17952a364 100644 (file)
@@ -1,6 +1,8 @@
 #include <msp/strings/format.h>
 #include "device.h"
 
+using namespace std;
+
 namespace Msp {
 namespace Input {
 
@@ -11,6 +13,16 @@ Device::Device(DeviceType t):
 Device::~Device()
 { }
 
+Device *Device::find_subdevice(const string &n)
+{
+       return (n==name ? this : 0);
+}
+
+Device *Device::find_subdevice(DeviceType t, unsigned i)
+{
+       return (t==type && i==0 ? this : 0);
+}
+
 bool Device::get_button_state(unsigned btn) const
 {
        if(btn>=buttons.size())