Commit 02fc0b45 authored by Olivier Fourdan's avatar Olivier Fourdan 🛠

clutter/evdev: Implement togglekeys notification

Notify with a system sound when the modifiers lock state is changed.

Closes: GNOME/mutter#637
parent 36155f72
......@@ -1246,6 +1246,13 @@ clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *dev
device->a11y_flags = settings->controls;
}
void
clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *device)
{
if (device->a11y_flags & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED)
clutter_input_device_evdev_bell_notify ();
}
static void
release_device_touch_slot (gpointer value)
{
......
......@@ -150,6 +150,7 @@ void clutter_input_device_evdev_release_touch_state (Clutte
void clutter_input_device_evdev_release_touch_slots (ClutterInputDeviceEvdev *device_evdev,
uint64_t time_us);
void clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *);
G_END_DECLS
......
......@@ -326,6 +326,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
backend = clutter_get_default_backend ();
g_signal_emit_by_name (clutter_backend_get_keymap (backend), "state-changed");
clutter_seat_evdev_sync_leds (seat);
clutter_evdev_a11y_maybe_notify_toggle_keys (CLUTTER_INPUT_DEVICE_EVDEV (seat->core_keyboard));
}
if (state == 0 || /* key release */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment