libvirtualhid latest
Cross-platform C++ library for virtual HID devices.
lvh::Trackpad Class Referencefinal

Virtual trackpad device handle. More...

#include <src/include/libvirtualhid/runtime.hpp>

Inheritance diagram for lvh::Trackpad:
[legend]
Collaboration diagram for lvh::Trackpad:
[legend]

Public Member Functions

OperationStatus button (bool pressed)
 Submit a physical trackpad button transition.
 
OperationStatus close () override
 Close the virtual device.
 
DeviceId device_id () const override
 Get the device identifier assigned by the runtime.
 
std::vector< DeviceNodedevice_nodes () const override
 Get platform-visible nodes associated with the device.
 
bool is_open () const override
 Check whether the device is open.
 
TouchContact last_submitted_contact () const
 Get the most recently submitted touch contact.
 
Trackpadoperator= (const Trackpad &)=delete
 Copy assignment is disabled because the handle owns device lifetime.
 
Trackpadoperator= (Trackpad &&other) noexcept
 Move assign a trackpad handle.
 
OperationStatus place_contact (const TouchContact &contact)
 Place or move a trackpad contact.
 
const DeviceProfileprofile () const override
 Get the profile used to create this device.
 
OperationStatus release_contact (std::int32_t contact_id)
 Release a trackpad contact.
 
std::size_t submit_count () const
 Get the number of successful submit operations.
 
 Trackpad (const Trackpad &)=delete
 Copy construction is disabled because the handle owns device lifetime.
 
 Trackpad (detail::RuntimeConstructionToken token, std::shared_ptr< detail::TrackpadDevice > device)
 Construct a trackpad handle for Runtime-owned state.
 
 Trackpad (Trackpad &&other) noexcept
 Move construct a trackpad handle.
 
 ~Trackpad () override
 Destroy the trackpad handle and close the virtual device if it is still open.
 
- Public Member Functions inherited from lvh::VirtualDevice
virtual ~VirtualDevice ()=default
 Destroy the virtual device handle.
 

Detailed Description

Virtual trackpad device handle.

Constructor & Destructor Documentation

◆ Trackpad() [1/2]

lvh::Trackpad::Trackpad ( Trackpad && other)
noexcept

Move construct a trackpad handle.

Parameters
otherHandle to move from.

◆ Trackpad() [2/2]

lvh::Trackpad::Trackpad ( detail::RuntimeConstructionToken token,
std::shared_ptr< detail::TrackpadDevice > device )

Construct a trackpad handle for Runtime-owned state.

Parameters
tokenRuntime construction token.
deviceShared trackpad state.

Member Function Documentation

◆ button()

OperationStatus lvh::Trackpad::button ( bool pressed)

Submit a physical trackpad button transition.

Parameters
pressedWhether the primary trackpad button is pressed.
Returns
Submit operation status.

◆ close()

OperationStatus lvh::Trackpad::close ( )
overridevirtual

Close the virtual device.

Returns
Close operation status.

Implements lvh::VirtualDevice.

◆ device_id()

DeviceId lvh::Trackpad::device_id ( ) const
overridevirtual

Get the device identifier assigned by the runtime.

Returns
Device identifier.

Implements lvh::VirtualDevice.

◆ device_nodes()

std::vector< DeviceNode > lvh::Trackpad::device_nodes ( ) const
overridevirtual

Get platform-visible nodes associated with the device.

Returns
Device nodes and diagnostic paths currently known to the backend.

Implements lvh::VirtualDevice.

◆ is_open()

bool lvh::Trackpad::is_open ( ) const
overridevirtual

Check whether the device is open.

Returns
true when the device can accept operations.

Implements lvh::VirtualDevice.

◆ last_submitted_contact()

TouchContact lvh::Trackpad::last_submitted_contact ( ) const

Get the most recently submitted touch contact.

Returns
Last submitted touch contact.

◆ operator=() [1/2]

Trackpad & lvh::Trackpad::operator= ( const Trackpad & )
delete

Copy assignment is disabled because the handle owns device lifetime.

Returns
This trackpad handle.

◆ operator=() [2/2]

Trackpad & lvh::Trackpad::operator= ( Trackpad && other)
noexcept

Move assign a trackpad handle.

Parameters
otherHandle to move from.
Returns
This trackpad handle.

◆ place_contact()

OperationStatus lvh::Trackpad::place_contact ( const TouchContact & contact)

Place or move a trackpad contact.

Parameters
contactTouch contact state.
Returns
Submit operation status.

◆ profile()

const DeviceProfile & lvh::Trackpad::profile ( ) const
overridevirtual

Get the profile used to create this device.

Returns
Device profile.

Implements lvh::VirtualDevice.

◆ release_contact()

OperationStatus lvh::Trackpad::release_contact ( std::int32_t contact_id)

Release a trackpad contact.

Parameters
contact_idConsumer-stable contact identifier.
Returns
Submit operation status.

◆ submit_count()

std::size_t lvh::Trackpad::submit_count ( ) const

Get the number of successful submit operations.

Returns
Submit count.

The documentation for this class was generated from the following file: