summaryrefslogtreecommitdiff
path: root/gdk/win32/gdkkeys-win32.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-04-14 13:25:38 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-04-27 20:07:52 -0300
commitfea2e7bf3515e8a850944715a7caf77f33d1b693 (patch)
tree87919b82aa950919095fb253eb0e44de7201e3e1 /gdk/win32/gdkkeys-win32.c
parentaa269d93c4a3ccbe3e22c825b326335e46937708 (diff)
downloadgtk+-fea2e7bf3515e8a850944715a7caf77f33d1b693.tar.gz
gdkkeys: Add support to _get_scroll_lock_state()
GdkKeymap already has support for _get_num_lock_state() and _get_caps_lock_state(). Adding _get_scroll_lock_state() would be good for completness and some backends (Windows?) could take advantage of this.
Diffstat (limited to 'gdk/win32/gdkkeys-win32.c')
-rw-r--r--gdk/win32/gdkkeys-win32.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdk/win32/gdkkeys-win32.c b/gdk/win32/gdkkeys-win32.c
index fe9c05c409..46c472e034 100644
--- a/gdk/win32/gdkkeys-win32.c
+++ b/gdk/win32/gdkkeys-win32.c
@@ -564,6 +564,12 @@ gdk_win32_keymap_get_num_lock_state (GdkKeymap *keymap)
}
static gboolean
+gdk_win32_keymap_get_scroll_lock_state (GdkKeymap *keymap)
+{
+ return ((GetKeyState (VK_SCROLL) & 1) != 0);
+}
+
+static gboolean
gdk_win32_keymap_get_entries_for_keyval (GdkKeymap *keymap,
guint keyval,
GdkKeymapKey **keys,
@@ -930,6 +936,7 @@ gdk_win32_keymap_class_init (GdkWin32KeymapClass *klass)
keymap_class->have_bidi_layouts = gdk_win32_keymap_have_bidi_layouts;
keymap_class->get_caps_lock_state = gdk_win32_keymap_get_caps_lock_state;
keymap_class->get_num_lock_state = gdk_win32_keymap_get_num_lock_state;
+ keymap_class->get_scroll_lock_state = gdk_win32_keymap_get_scroll_lock_state;
keymap_class->get_entries_for_keyval = gdk_win32_keymap_get_entries_for_keyval;
keymap_class->get_entries_for_keycode = gdk_win32_keymap_get_entries_for_keycode;
keymap_class->lookup_key = gdk_win32_keymap_lookup_key;