Skip to content

Commit

Permalink
core: generic: Add function to quickly check the device type
Browse files Browse the repository at this point in the history
  • Loading branch information
StollD committed Mar 3, 2024
1 parent 1e45679 commit 356ecfc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/generic/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ struct DeviceInfo {
u16 product = 0;
ipts::Device::Type type {};
std::optional<ipts::Metadata> meta = std::nullopt;

[[nodiscard]] bool is_touchscreen() const
{
return this->type == ipts::Device::Type::Touchscreen;
}

[[nodiscard]] bool is_touchpad() const
{
return this->type == ipts::Device::Type::Touchpad;
}
};

} // namespace iptsd::core
Expand Down

0 comments on commit 356ecfc

Please sign in to comment.