From d67b38f96086d8cec316784516154b3af4a449eb Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Wed, 15 Jan 2014 17:54:25 +0100 Subject: [PATCH] evdev: Make the keymap available Make the keymap available so that consumers don't have to duplicate it if they need it. https://bugzilla.gnome.org/show_bug.cgi?id=725102 --- clutter/evdev/clutter-device-manager-evdev.c | 20 ++++++++++++++++++++ clutter/evdev/clutter-evdev.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c index 53fc90b55..266d08fa2 100644 --- a/clutter/evdev/clutter-device-manager-evdev.c +++ b/clutter/evdev/clutter-device-manager-evdev.c @@ -1513,6 +1513,26 @@ clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev, } } +/** + * clutter_evdev_get_keyboard_map: (skip) + * @evdev: the #ClutterDeviceManager created by the evdev backend + * + * Retrieves the #xkb_keymap in use by the evdev backend. + * + * Return value: the #xkb_keymap. + */ +struct xkb_keymap * +clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev) +{ + ClutterDeviceManagerEvdev *manager_evdev; + + g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev)); + + manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev); + + return xkb_state_get_keymap (manager_evdev->priv->main_seat->xkb); +} + /** * clutter_evdev_set_pointer_constrain_callback: * @evdev: the #ClutterDeviceManager created by the evdev backend diff --git a/clutter/evdev/clutter-evdev.h b/clutter/evdev/clutter-evdev.h index e57dc6be5..74eb00dd7 100644 --- a/clutter/evdev/clutter-evdev.h +++ b/clutter/evdev/clutter-evdev.h @@ -85,6 +85,8 @@ void clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager void clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev, struct xkb_keymap *keymap); +struct xkb_keymap * clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev); + void clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev, gboolean repeat, guint32 delay,