From 0db9075562550fd1018b9af694b27d499d9dbe52 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 14 Aug 2013 16:49:00 +0200 Subject: [PATCH] ClutterInputDevice: add new API for querying the modifier state This way, the full state of the device is exposed. https://bugzilla.gnome.org/show_bug.cgi?id=706494 --- clutter/clutter-input-device.c | 19 +++++++++++++++++++ clutter/clutter-input-device.h | 2 ++ clutter/clutter.symbols | 1 + 3 files changed, 22 insertions(+) diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c index 2e3afee30..38f7fd737 100644 --- a/clutter/clutter-input-device.c +++ b/clutter/clutter-input-device.c @@ -467,6 +467,25 @@ _clutter_input_device_set_state (ClutterInputDevice *device, device->current_state = state; } +/** + * clutter_input_device_get_modifier_state: + * @device: a #ClutterInputDevice + * + * Retrieves the current modifiers state of the device, as seen + * by the last event Clutter processed. + * + * Return value: the last known modifier state + * + * Since: 1.16 + */ +ClutterModifierType +clutter_input_device_get_modifier_state (ClutterInputDevice *device) +{ + g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0); + + return device->current_state; +} + /*< private > * clutter_input_device_set_time: * @device: a #ClutterInputDevice diff --git a/clutter/clutter-input-device.h b/clutter/clutter-input-device.h index 1a5a4a1c5..40edadfee 100644 --- a/clutter/clutter-input-device.h +++ b/clutter/clutter-input-device.h @@ -56,6 +56,8 @@ CLUTTER_AVAILABLE_IN_1_12 gboolean clutter_input_device_get_coords (ClutterInputDevice *device, ClutterEventSequence *sequence, ClutterPoint *point); +CLUTTER_AVAILABLE_IN_1_16 +ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device); ClutterActor * clutter_input_device_get_pointer_actor (ClutterInputDevice *device); ClutterStage * clutter_input_device_get_pointer_stage (ClutterInputDevice *device); const gchar * clutter_input_device_get_device_name (ClutterInputDevice *device); diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols index 155bbfee5..a397d3176 100644 --- a/clutter/clutter.symbols +++ b/clutter/clutter.symbols @@ -855,6 +855,7 @@ clutter_input_device_get_has_cursor clutter_input_device_get_key clutter_input_device_get_n_axes clutter_input_device_get_n_keys +clutter_input_device_get_modifier_state clutter_input_device_get_pointer_actor clutter_input_device_get_pointer_stage clutter_input_device_get_slave_devices