Skip to content

Commit 356ecfc

Browse files
committed
core: generic: Add function to quickly check the device type
1 parent 1e45679 commit 356ecfc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/generic/device.hpp

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ struct DeviceInfo {
2020
u16 product = 0;
2121
ipts::Device::Type type {};
2222
std::optional<ipts::Metadata> meta = std::nullopt;
23+
24+
[[nodiscard]] bool is_touchscreen() const
25+
{
26+
return this->type == ipts::Device::Type::Touchscreen;
27+
}
28+
29+
[[nodiscard]] bool is_touchpad() const
30+
{
31+
return this->type == ipts::Device::Type::Touchpad;
32+
}
2333
};
2434

2535
} // namespace iptsd::core

0 commit comments

Comments
 (0)