Louvre
v2.13.0-1
C++ library for Wayland compositors
|
Input Device. More...
Public Types | |
enum | Capability : UInt32 |
Input device capabilities. More... | |
Public Member Functions | |
bool | hasCapability (Capability capability) const noexcept |
Checks if the device has the given capability. More... | |
const std::string & | name () const noexcept |
Gets the name of the input device. More... | |
UInt32 | productId () const noexcept |
Gets the product ID of the input device. More... | |
UInt32 | vendorId () const noexcept |
Gets the vendor ID of the input device. More... | |
void * | nativeHandle () const noexcept |
Native data structure used by the current input backend. More... | |
Input Device.
This class provides basic information about an input device and a way to access its underlying backend handle so that it can be configured using backend-specific APIs.
Use LSeat::inputDevices() to access all available devices, and LSeat::inputDevicePlugged() and LSeat::inputDeviceUnplugged() to listen for hotplug events.
Each subtype of LInputEvent provides access to the input device that generated it through LInputEvent::device().
nullptr
.Devices are not categorized by type but by their capabilities. Use hasCapability() to check for a specific capability.
Louvre does not provide a generic API for configuring input devices. Instead, nativeHandle() can be used to access the data structure used by the current input backend. For example, if the LInputBackendLibinput backend is used, the native handle represents a libinput_device struct, which can be configured through the libinput API.
Use LCompositor::inputBackendId() to check which input backend is currently loaded.
nullptr
if the input backend does not provide a handle or if the input device has been unplugged. enum Capability : UInt32 |
|
inlinenoexcept |
Checks if the device has the given capability.
capability | The capability to check. |
true
if the device has the capability, otherwise false
.
|
inlinenoexcept |
Gets the name of the input device.
|
inlinenoexcept |
Gets the product ID of the input device.
|
inlinenoexcept |
Gets the vendor ID of the input device.
|
inlinenoexcept |
Native data structure used by the current input backend.
libinput_device
struct.nullptr
.nullptr
in cases where the input backend does not provide a handle or the input device has been unplugged.