diff --git a/clutter/clutter/clutter-device-manager-private.h b/clutter/clutter/clutter-device-manager-private.h index 57423c41a..2364fd27c 100644 --- a/clutter/clutter/clutter-device-manager-private.h +++ b/clutter/clutter/clutter-device-manager-private.h @@ -145,6 +145,9 @@ struct _ClutterInputDevice guint is_enabled : 1; }; +typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event, + ClutterInputDevice *device); + struct _ClutterInputDeviceClass { GObjectClass parent_class; @@ -163,6 +166,11 @@ struct _ClutterInputDeviceClass gboolean (* is_grouped) (ClutterInputDevice *device, ClutterInputDevice *other_device); + + /* Keyboard accessbility */ + void (* process_kbd_a11y_event) (ClutterEvent *event, + ClutterInputDevice *device, + ClutterEmitInputDeviceEvent emit_event_func); }; /* Platform-dependent interface */ diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index 0f85db6eb..46537f322 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -2089,6 +2089,21 @@ emit_keyboard_event (ClutterEvent *event, } } +static inline void +process_key_event (ClutterEvent *event, + ClutterInputDevice *device) +{ + ClutterInputDeviceClass *device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device); + + if (device_class->process_kbd_a11y_event) + { + device_class->process_kbd_a11y_event (event, device, emit_keyboard_event); + return; + } + + emit_keyboard_event (event, device); +} + static gboolean is_off_stage (ClutterActor *stage, gfloat x, @@ -2176,7 +2191,7 @@ _clutter_process_event_details (ClutterActor *stage, } } - emit_keyboard_event (event, device); + process_key_event (event, device); } break;