Class LocatePointer

Class Documentation

class LocatePointer

Public Functions

void operator()(mir::Server &server)
explicit LocatePointer(miral::live_config::Store &config_store)

Construct a LocatePointer instance with access to a live config store.

Available options:

  • {locate_pointer, enable}: Enable or disable locate pointer.

  • {locate_pointer, delay}: The delay between scheduling a request and the on_locate_pointer callback being called.

LocatePointer &delay(std::chrono::milliseconds delay)

The delay between scheduling a request and the on_locate_pointer callback being called.

Note

The default delay is 500 milliseconds

LocatePointer &on_locate_pointer(std::function<void(mir::geometry::PointF pointer_position)>&&)

Configures the callback that’s invoked after schedule_request is called by delay milliseconds. Useful for providing feedback to users.

LocatePointer &enable()
LocatePointer &disable()
void schedule_request()

Schedules the callback provided to on_locate_pointer to be called with the current mouse position at a point in the future specified by delay. If cancel_request is called after this, then the callback will not be called.

Note

If the LocatePointer instance is disabled, this method has no effect.

void cancel_request()

Cancels the request established by schedule_request. If a request is not pending, then nothing happens.

Note

If the LocatePointer instance is disabled, this method has no effect.

Public Static Functions

static auto enabled() -> LocatePointer

Creates a LocatePointer instance that’s enabled by default.

static auto disabled() -> LocatePointer

Creates a LocatePointer instance that’s disabled by default.