Class SlowKeys¶
Defined in File slow_keys.h
Class Documentation¶
-
class SlowKeys¶
Enables configuring slow keys at runtime.
Slow keys is an accessibility feature that enables the rejection of keypresses that don’t last long enough. It can be useful in cases where the user has issues that cause them to press buttons accidentally.
You can optionally assign handlers for when the key is pressed down, is rejected, or when the press is accepted.
Remark
Since MirAL 5.5
Public Functions
-
explicit SlowKeys(miral::live_config::Store &config_store)¶
Construct a
SlowKeys
instance with access to a live config store.Available options:
{slow_keys, enable}: Enable or disable slow keys.
{slow_keys, hold_delay}: How much time in milliseconds must pass between keypresses to not be rejected.
-
void operator()(mir::Server &server)¶
-
SlowKeys &hold_delay(std::chrono::milliseconds hold_delay)¶
Configures the duration a key has to be pressed down for to register as a key press.
Note
The default hold delay is 200 milliseconds.
-
SlowKeys &on_key_down(std::function<void(MirKeyboardEvent const*)> &&on_key_down)¶
Configures the callback that’s invoked when the key is pressed down. Useful for providing feedback to users.
-
explicit SlowKeys(miral::live_config::Store &config_store)¶