2008-07-01 22:57:50 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
2000-12-06 05:31:30 +00:00
|
|
|
* Copyright (C) 2000 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2000-12-06 05:31:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2012-12-28 14:57:34 +00:00
|
|
|
#ifndef __GDK_KEYS_H__
|
|
|
|
#define __GDK_KEYS_H__
|
|
|
|
|
2019-11-27 13:33:43 +00:00
|
|
|
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
2008-05-28 14:01:57 +00:00
|
|
|
#error "Only <gdk/gdk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2012-02-27 12:07:48 +00:00
|
|
|
#include <gdk/gdkversionmacros.h>
|
2000-12-06 05:31:30 +00:00
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
|
2005-06-12 05:32:25 +00:00
|
|
|
G_BEGIN_DECLS
|
2000-12-06 05:31:30 +00:00
|
|
|
|
2010-11-15 03:34:40 +00:00
|
|
|
|
2000-12-06 05:31:30 +00:00
|
|
|
typedef struct _GdkKeymapKey GdkKeymapKey;
|
|
|
|
|
2010-11-15 03:34:40 +00:00
|
|
|
/**
|
|
|
|
* GdkKeymapKey:
|
|
|
|
* @keycode: the hardware keycode. This is an identifying number for a
|
|
|
|
* physical key.
|
|
|
|
* @group: indicates movement in a horizontal direction. Usually groups are used
|
|
|
|
* for two different languages. In group 0, a key might have two English
|
|
|
|
* characters, and in group 1 it might have two Hebrew characters. The Hebrew
|
|
|
|
* characters will be printed on the key next to the English characters.
|
|
|
|
* @level: indicates which symbol on the key will be used, in a vertical direction.
|
2014-02-05 19:50:22 +00:00
|
|
|
* So on a standard US keyboard, the key with the number “1” on it also has the
|
2010-11-15 03:34:40 +00:00
|
|
|
* exclamation point ("!") character on it. The level indicates whether to use
|
2014-02-05 19:50:22 +00:00
|
|
|
* the “1” or the “!” symbol. The letter keys are considered to have a lowercase
|
2010-11-15 03:34:40 +00:00
|
|
|
* letter at level 0, and an uppercase letter at level 1, though only the
|
|
|
|
* uppercase letter is printed.
|
|
|
|
*
|
|
|
|
* A #GdkKeymapKey is a hardware key that can be mapped to a keyval.
|
|
|
|
*/
|
2000-12-06 05:31:30 +00:00
|
|
|
struct _GdkKeymapKey
|
|
|
|
{
|
|
|
|
guint keycode;
|
|
|
|
gint group;
|
|
|
|
gint level;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define GDK_TYPE_KEYMAP (gdk_keymap_get_type ())
|
|
|
|
#define GDK_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_KEYMAP, GdkKeymap))
|
|
|
|
#define GDK_IS_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_KEYMAP))
|
2010-11-15 03:34:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GdkKeymap:
|
|
|
|
*
|
|
|
|
* A #GdkKeymap defines the translation from keyboard state
|
|
|
|
* (including a hardware key, a modifier mask, and active keyboard group)
|
|
|
|
* to a keyval. This translation has two phases. The first phase is
|
|
|
|
* to determine the effective keyboard group and level for the keyboard
|
|
|
|
* state; the second phase is to look up the keycode/group/level triplet
|
|
|
|
* in the keymap and see what keyval it corresponds to.
|
|
|
|
*/
|
2000-12-06 05:31:30 +00:00
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
GType gdk_keymap_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2018-01-12 02:43:01 +00:00
|
|
|
GdkDisplay * gdk_keymap_get_display (GdkKeymap *keymap);
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2001-06-08 16:07:00 +00:00
|
|
|
guint gdk_keymap_lookup_key (GdkKeymap *keymap,
|
|
|
|
const GdkKeymapKey *key);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2001-06-08 16:07:00 +00:00
|
|
|
gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
|
|
|
guint hardware_keycode,
|
|
|
|
GdkModifierType state,
|
|
|
|
gint group,
|
|
|
|
guint *keyval,
|
|
|
|
gint *effective_group,
|
|
|
|
gint *level,
|
2002-02-21 17:14:10 +00:00
|
|
|
GdkModifierType *consumed_modifiers);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2001-06-08 16:07:00 +00:00
|
|
|
gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
|
|
|
|
guint keyval,
|
|
|
|
GdkKeymapKey **keys,
|
|
|
|
gint *n_keys);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2001-06-08 16:07:00 +00:00
|
|
|
gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
|
|
|
|
guint hardware_keycode,
|
|
|
|
GdkKeymapKey **keys,
|
|
|
|
guint **keyvals,
|
|
|
|
gint *n_entries);
|
2010-11-15 03:34:40 +00:00
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2001-06-08 16:07:00 +00:00
|
|
|
PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2007-06-30 01:43:04 +00:00
|
|
|
gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-09-29 20:40:45 +00:00
|
|
|
gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-07-01 22:45:06 +00:00
|
|
|
gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2015-04-14 11:25:38 +00:00
|
|
|
gboolean gdk_keymap_get_scroll_lock_state (GdkKeymap *keymap);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2012-02-20 23:30:44 +00:00
|
|
|
guint gdk_keymap_get_modifier_state (GdkKeymap *keymap);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-02-12 20:45:16 +00:00
|
|
|
void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
|
|
|
GdkModifierType *state);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2009-12-21 16:15:28 +00:00
|
|
|
gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
|
|
|
|
GdkModifierType *state);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2011-09-27 07:50:34 +00:00
|
|
|
GdkModifierType gdk_keymap_get_modifier_mask (GdkKeymap *keymap,
|
|
|
|
GdkModifierIntent intent);
|
|
|
|
|
2000-12-06 05:31:30 +00:00
|
|
|
|
|
|
|
/* Key values
|
|
|
|
*/
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
gchar* gdk_keyval_name (guint keyval) G_GNUC_CONST;
|
2010-11-15 03:34:40 +00:00
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
guint gdk_keyval_from_name (const gchar *keyval_name);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
void gdk_keyval_convert_case (guint symbol,
|
|
|
|
guint *lower,
|
|
|
|
guint *upper);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
guint gdk_keyval_to_upper (guint keyval) G_GNUC_CONST;
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
guint gdk_keyval_to_lower (guint keyval) G_GNUC_CONST;
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
gboolean gdk_keyval_is_upper (guint keyval) G_GNUC_CONST;
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
gboolean gdk_keyval_is_lower (guint keyval) G_GNUC_CONST;
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
guint32 gdk_keyval_to_unicode (guint keyval) G_GNUC_CONST;
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2000-12-06 05:31:30 +00:00
|
|
|
guint gdk_unicode_to_keyval (guint32 wc) G_GNUC_CONST;
|
|
|
|
|
|
|
|
|
2005-06-12 05:32:25 +00:00
|
|
|
G_END_DECLS
|
2000-12-06 05:31:30 +00:00
|
|
|
|
|
|
|
#endif /* __GDK_KEYS_H__ */
|