Class BounceKeys

Class Documentation

class BounceKeys

Enables configuring bounce keys at runtime.

Bounce keys is an accessibility feature that enables rejection of keypresses of the same key that occur within a certain delay of each other. Optionally, you (the shell author) can attach a rejection handler to provide feedback to users.

Remark

Since MirAL 5.5

Public Functions

explicit BounceKeys(live_config::Store &config_store)

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

void operator()(mir::Server&)
BounceKeys &enable()

Enables bounce keys. When already enabled, further calls have no effect.

BounceKeys &disable()

Disables bounce keys. When already disabled, further calls have no effect.

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

Configures the duration users have to hold a key down for the press to register.

BounceKeys &on_press_rejected(std::function<void(unsigned int keysym)>&&)

Configures the callback to invoke when a keypress is rejected. Can be used to provide audio feedback or to initialize animations for graphical feedback.

Public Static Functions

static auto enabled() -> BounceKeys

Creates a BounceKeys instance that’s enabled by default.

static auto disabled() -> BounceKeys

Creates a BounceKeys instance that’s disabled by default.