/usr/share/gtk-doc/html/pygtk/class-gdkkeymap.html is in python-gtk2-doc 2.24.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.gdk.Keymap</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="prev" href="class-gdkimage.html" title="gtk.gdk.Image"><link rel="next" href="class-gdkpangorenderer.html" title="gtk.gdk.PangoRenderer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.Keymap</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkimage.html">Prev</a> </td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gdkpangorenderer.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.gdk.Keymap"><a name="class-gdkkeymap"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.gdk.Keymap</h2><p>gtk.gdk.Keymap — an object containing mappings of keys to key
values.</p></div><div class="refsect1" title="Synopsis"><a name="id3218119"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.Keymap</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#method-gdkkeymap--lookup-key" title="gtk.gdk.Keymap.lookup_key">lookup_key</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keycode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>group</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>level</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#method-gdkkeymap--translate-keyboard-state" title="gtk.gdk.Keymap.translate_keyboard_state">translate_keyboard_state</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keycode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>state</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>group</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#method-gdkkeymap--get-entries-for-keyval" title="gtk.gdk.Keymap.get_entries_for_keyval">get_entries_for_keyval</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#method-gdkkeymap--get-entries-for-keycode" title="gtk.gdk.Keymap.get_entries_for_keycode">get_entries_for_keycode</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>hardware_keycode</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#method-gdkkeymap--get-direction" title="gtk.gdk.Keymap.get_direction">get_direction</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#method-gdkkeymap--have-bidi-layouts" title="gtk.gdk.Keymap.have_bidi_layouts">have_bidi_layouts</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keymap-get-default" title="gtk.gdk.keymap_get_default">gtk.gdk.keymap_get_default</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keymap-get-for-display" title="gtk.gdk.keymap_get_for_display">gtk.gdk.keymap_get_for_display</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>display</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-name" title="gtk.gdk.keyval_name">gtk.gdk.keyval_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-from-name" title="gtk.gdk.keyval_from_name">gtk.gdk.keyval_from_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval_name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-convert-case" title="gtk.gdk.keyval_convert_case">gtk.gdk.keyval_convert_case</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>symbol</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-to-upper" title="gtk.gdk.keyval_to_upper">gtk.gdk.keyval_to_upper</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-to-lower" title="gtk.gdk.keyval_to_lower">gtk.gdk.keyval_to_lower</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-is-upper" title="gtk.gdk.keyval_is_upper">gtk.gdk.keyval_is_upper</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-is-lower" title="gtk.gdk.keyval_is_lower">gtk.gdk.keyval_is_lower</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--keyval-to-unicode" title="gtk.gdk.keyval_to_unicode">gtk.gdk.keyval_to_unicode</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gdkkeymap.html#function-gdk--unicode-to-keyval" title="gtk.gdk.unicode_to_keyval">gtk.gdk.unicode_to_keyval</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>wc</code></strong></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3441978"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gdkkeymap.html" title="gtk.gdk.Keymap">gtk.gdk.Keymap</a>
</pre></div><div class="refsect1" title="Signal Prototypes"><a name="id3442005"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gdkkeymap.html#signal-gdkkeymap--direction-changed" title='The "direction-changed" gtk.gdk.Keymap Signal'>direction-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>gdkkeymap</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gdkkeymap.html#signal-gdkkeymap--keys-changed" title='The "keys-changed" gtk.gdk.Keymap Signal'>keys-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>gdkkeymap</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id3442137"></a><h2>Description</h2><p>A <a class="link" href="class-gdkkeymap.html" title="gtk.gdk.Keymap"><code class="classname">gtk.gdk.Keymap</code></a>
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. One <a class="link" href="class-gdkkeymap.html" title="gtk.gdk.Keymap"><code class="classname">gtk.gdk.Keymap</code></a>
object exists for each user display. <code class="literal">PyGTK</code> supports only
one display, so <a class="link" href="class-gdkkeymap.html#function-gdk--keymap-get-default" title="gtk.gdk.keymap_get_default"><code class="function">gtk.gdk.keymap_get_default()</code>()</a>
returns the singleton <a class="link" href="class-gdkkeymap.html" title="gtk.gdk.Keymap"><code class="classname">gtk.gdk.Keymap</code></a>.</p><p>A keymap is a mapping from a Keymap key to key values. You can
think of a Keymap key as a representation of a symbol printed on a physical
keyboard key. That is, it contains three pieces of information. First, it
contains the hardware keycode; this is an identifying number for a physical
key. Second, it contains the level of the key. The level indicates which
symbol on the key will be used, in a vertical direction. So on a standard US
keyboard, the key with the number "1" on it also has the exclamation point
("!") character on it. The level indicates whether to use the "1" or the "!"
symbol. The letter keys are considered to have a lowercase letter at level
0, and an uppercase letter at level 1, though only the uppercase letter is
printed. Third, the Keymap key contains a group; groups are not used on
standard US keyboards, but are used in many other countries. On a keyboard
with groups, there can be 3 or 4 symbols printed on a single key. The 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.
</p></div><div class="refsect1" title="Methods"><a name="id3442216"></a><h2>Methods</h2><div class="refsect2" title="gtk.gdk.Keymap.lookup_key"><a name="method-gdkkeymap--lookup-key"></a><h3>gtk.gdk.Keymap.lookup_key</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">lookup_key</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keycode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>group</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>level</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keycode</code></strong> :</span></p></td><td>the hardware keycode.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>group</code></strong> :</span></p></td><td>the key group</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>level</code></strong> :</span></p></td><td>the key level</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a keyval, or 0 if none was mapped to the
(<em class="parameter"><code>keycode</code></em>, <em class="parameter"><code>group</code></em>,
<em class="parameter"><code>level</code></em>) triplet.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">lookup_key</code>() method returns the
keyval mapped to the specified (<em class="parameter"><code>keycode</code></em>,
<em class="parameter"><code>group</code></em>, <em class="parameter"><code>level</code></em>) triplet. This
method returns 0 if no keyval is found. For normal user input, you want to
use the <a class="link" href="class-gdkkeymap.html#method-gdkkeymap--translate-keyboard-state" title="gtk.gdk.Keymap.translate_keyboard_state"><code class="methodname">translate_keyboard_state()</code></a>
method instead of this method, since the effective group or level may not be
the same as the current keyboard state.</p><p>The parameters to this method are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>keycode</code></em> :</span></p></td><td>the hardware keycode. This is an identifying number for
a physical key.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td><td>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.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td><td>indicates which symbol on the key will be used, in a
vertical direction. So on a standard US keyboard, the key with the number
"1" on it also has the exclamation point ("!") character on it. The level
indicates whether to use the "1" or the "!" symbol. The letter keys are
considered to have a lowercase letter at level 0, and an uppercase letter at
level 1, though only the uppercase letter is printed.</td></tr></tbody></table><p></p></div><div class="refsect2" title="gtk.gdk.Keymap.translate_keyboard_state"><a name="method-gdkkeymap--translate-keyboard-state"></a><h3>gtk.gdk.Keymap.translate_keyboard_state</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">translate_keyboard_state</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keycode</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>state</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>group</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keycode</code></strong> :</span></p></td><td>a keycode</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>state</code></strong> :</span></p></td><td>a modifier state</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>group</code></strong> :</span></p></td><td>an active keyboard group</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 4-tuple containing the keyval, the effective group,
the level and the modifiers that were used to determine the group or
level</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">translate_keyboard_state</code>() method
translates the contents of a keyboard <a class="link" href="class-gdkevent.html" title="gtk.gdk.Event"><code class="classname">gtk.gdk.Event</code></a>
(specified by <em class="parameter"><code>keycode</code></em>,
<em class="parameter"><code>state</code></em> and <em class="parameter"><code>group</code></em>) into a
keyval, effective group, level and consumed modifiers that affected
the translation (and are unavailable for application use) which are
returned in a 4-tuple. See the <a class="link" href="class-gdkkeymap.html#method-gdkkeymap--lookup-key" title="gtk.gdk.Keymap.lookup_key"><code class="methodname">lookup_key</code>()</a>
method for an explanation of groups and levels. The effective group is
the group that was actually used for the translation; some keys such
as <span class="keycap"><strong>Enter</strong></span> are not affected by the active keyboard
group. The level is derived from <em class="parameter"><code>state</code></em>. For
convenience, the keyboard <a class="link" href="class-gdkevent.html" title="gtk.gdk.Event"><code class="classname">gtk.gdk.Event</code></a>
already contains the translated keyval, so this method isn't as useful
as you might think.</p><p>The value of <em class="parameter"><code>state</code></em> or the consumed
modifiers is a combination of the <a class="xref" href="gdk-constants.html#gdk-modifier-constants" title="GDK Modifier Constants">GDK Modifier Constants</a>.</p><div class="refsect3" title="Consumed Modifiers"><a name="id3314303"></a><h4>Consumed Modifiers</h4><p>The consumed modifiers are modifiers that should be masked out
from <em class="parameter"><code>state</code></em> when comparing this key press to a hot
key. For instance, on a US keyboard, the <span class="keysym">plus</span> symbol is
shifted, so when comparing a key press to a
<span class="keycap"><strong>Control</strong></span>+<span class="keysym">plus</span>
accelerator <span class="keycap"><strong>Shift</strong></span> should be masked out. For
example:</p><pre class="programlisting">
# We want to ignore irrelevant modifiers like ScrollLock
ALL_ACCELS_MASK = (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK
| gtk.gdk.MOD1_MASK)
keyval, egroup, level, consumed = keymap.translate_keyboard_state(
event.hardware_keycode, event.state, event.group)
if (keyval == gtk.keysyms.plus and
(event.state & ~consumed & ALL_ACCELS_MASK) == gtk.gdk.CONTROL_MASK):
# Control was pressed
</pre><p>Note that most keys that are affected by the
<span class="keycap"><strong>Shift</strong></span> key will have <code class="literal">gtk.gdk.SHIFT_MASK</code>
part of the consumed modifiers (e.g. <span class="keycap"><strong>Control</strong></span>+<span class="keycap"><strong>Shift</strong></span>+<span class="keycap"><strong>Tab</strong></span>).</p><p>All single modifier combinations that could affect the key for
any combination of modifiers will be returned in consumed_modifiers.
Multi-modifier combinations are returned only when actually found in
<em class="parameter"><code>state</code></em>. When you store accelerators, you should always
store them with consumed modifiers removed. Store <Control>plus, not
<Control><Shift>plus,</p></div></div><div class="refsect2" title="gtk.gdk.Keymap.get_entries_for_keyval"><a name="method-gdkkeymap--get-entries-for-keyval"></a><h3>gtk.gdk.Keymap.get_entries_for_keyval</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_entries_for_keyval</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>a keyval, such as <code class="literal">GDK_a</code>,
<code class="literal">GDK_Up</code>, <code class="literal">GDK_Return</code>,
etc.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a tuple containing 3-tuple containing a keycode,
a group and a level that will generate
<em class="parameter"><code>keyval</code></em>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_entries_for_keyval</code>() method
returns a tuple of (keycode, group, level) 3-tuples that will generate
<em class="parameter"><code>keyval</code></em>. Groups and levels are two kinds of keyboard
mode; in general, the level determines whether the top or bottom symbol on a
key is used, and the group determines whether the left or right symbol is
used. On US keyboards, the shift key changes the keyboard level, and there
are no groups. A group switch key might convert a keyboard between Hebrew to
English modes, for example, the <code class="literal">gtk.gdk.KEY_PRESS</code> and
<code class="literal">gtk.gdk.KEY_RELEASE</code> <a class="link" href="class-gdkevent.html" title="gtk.gdk.Event"><code class="classname">gtk.gdk.Event</code></a> objects
contain a <code class="literal">group</code> attribute that indicates the active
keyboard group. The level is computed from the modifier mask.</p></div><div class="refsect2" title="gtk.gdk.Keymap.get_entries_for_keycode"><a name="method-gdkkeymap--get-entries-for-keycode"></a><h3>gtk.gdk.Keymap.get_entries_for_keycode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_entries_for_keycode</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>hardware_keycode</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>hardware_keycode</code></strong> :</span></p></td><td>a keycode</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a tuple containing 4-tuples: (keyval, keycode,
group, level)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_entries_for_keycode</code>() method
returns a tuple containing 4-tuples with: the keyvals bound to
<em class="parameter"><code>hardware_keycode</code></em>, the keycode, the group and the
level. When a keycode is pressed by the user, the keyval from this list of
entries is selected by considering the effective keyboard group and
level. See the <a class="link" href="class-gdkkeymap.html#method-gdkkeymap--translate-keyboard-state" title="gtk.gdk.Keymap.translate_keyboard_state"><code class="methodname">translate_keyboard_state()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.gdk.Keymap.get_direction"><a name="method-gdkkeymap--get-direction"></a><h3>gtk.gdk.Keymap.get_direction</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_direction</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a Pango direction: <code class="literal">pango.DIRECTION_LTR</code> or <code class="literal">pango.DIRECTION_RTL</code>.</td></tr></tbody></table><p>The <code class="methodname">get_direction</code>() method returns the direction of the keymap.</p></div><div class="refsect2" title="gtk.gdk.Keymap.have_bidi_layouts"><a name="method-gdkkeymap--have-bidi-layouts"></a><h3>gtk.gdk.Keymap.have_bidi_layouts</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">have_bidi_layouts</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if there are layouts in both directions,
<code class="literal">False</code> otherwise.</td></tr></tbody></table><p>The <code class="methodname">have_bidi_layouts</code>() method
determines if keyboard layouts for both right-to-left and left-to-right
languages are in use.</p></div></div><div class="refsect1" title="Functions"><a name="id3314814"></a><h2>Functions</h2><div class="refsect2" title="gtk.gdk.keymap_get_default"><a name="function-gdk--keymap-get-default"></a><h3>gtk.gdk.keymap_get_default</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keymap_get_default</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the default gdk keymap for the
display.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keymap_get_default</code>() function
returns the default <a class="link" href="class-gdkkeymap.html" title="gtk.gdk.Keymap"><code class="classname">gtk.gdk.Keymap</code></a> for
the display.</p></div><div class="refsect2" title="gtk.gdk.keymap_get_for_display"><a name="function-gdk--keymap-get-for-display"></a><h3>gtk.gdk.keymap_get_for_display</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keymap_get_for_display</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>display</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>display</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkdisplay.html" title="gtk.gdk.Display"><code class="classname">gtk.gdk.Display</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the keymap for
<em class="parameter"><code>display</code></em>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.2 and above.</p></div><p>The <code class="function">gtk.gdk.keymap_get_for_display</code>()
function returns the <a class="link" href="class-gdkkeymap.html" title="gtk.gdk.Keymap"><code class="classname">gtk.gdk.Keymap</code></a> for
the <a class="link" href="class-gdkdisplay.html" title="gtk.gdk.Display"><code class="classname">gtk.gdk.Display</code></a>
specified by <em class="parameter"><code>display</code></em>.</p></div><div class="refsect2" title="gtk.gdk.keyval_name"><a name="function-gdk--keyval-name"></a><h3>gtk.gdk.keyval_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>a key value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string containing the name of the key, or
None if keyval is not a valid key.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_name</code>() function converts
the key value specified by <em class="parameter"><code>keyval</code></em> into a symbolic
name.</p></div><div class="refsect2" title="gtk.gdk.keyval_from_name"><a name="function-gdk--keyval-from-name"></a><h3>gtk.gdk.keyval_from_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_from_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval_name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval_name</code></strong> :</span></p></td><td>a key name</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the corresponding key value or 0 if the key
name is not a valid key.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_from_name</code>() function
converts the key name specified by <em class="parameter"><code>keyval_name</code></em> to a
key value.</p></div><div class="refsect2" title="gtk.gdk.keyval_convert_case"><a name="function-gdk--keyval-convert-case"></a><h3>gtk.gdk.keyval_convert_case</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_convert_case</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>symbol</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>symbol</code></strong> :</span></p></td><td>a keyval</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing the lowercase and
uppercase versions of
<em class="parameter"><code>symbol</code></em></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The <code class="function">gtk.gdk.keyval_convert_case</code>() function
returns the lowercase and uppercase versions of the keyval specified by
<em class="parameter"><code>symbol</code></em>.</p></div><div class="refsect2" title="gtk.gdk.keyval_to_upper"><a name="function-gdk--keyval-to-upper"></a><h3>gtk.gdk.keyval_to_upper</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_to_upper</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>a key value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the upper case form of keyval, or keyval itself
if it is already in upper case or it is not subject to case
conversion.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_to_upper</code>() function
converts the key value specified by <em class="parameter"><code>keyval</code></em> to upper
case, if applicable.</p></div><div class="refsect2" title="gtk.gdk.keyval_to_lower"><a name="function-gdk--keyval-to-lower"></a><h3>gtk.gdk.keyval_to_lower</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_to_lower</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>the key value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the lower case form of keyval, or keyval itself
if it is already in lower case or it is not subject to case
conversion.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_to_lower</code>() function
converts the key value specified by <em class="parameter"><code>keyval</code></em> to lower
case, if applicable. </p></div><div class="refsect2" title="gtk.gdk.keyval_is_upper"><a name="function-gdk--keyval-is-upper"></a><h3>gtk.gdk.keyval_is_upper</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_is_upper</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>the key value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if
<em class="parameter"><code>keyval</code></em> is in upper case or if keyval is not subject
to case conversion.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_is_upper</code>() function
returns <code class="literal">True</code> if the key value specified by
<em class="parameter"><code>keyval</code></em> is in upper case or not subject to case
conversion.</p></div><div class="refsect2" title="gtk.gdk.keyval_is_lower"><a name="function-gdk--keyval-is-lower"></a><h3>gtk.gdk.keyval_is_lower</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_is_lower</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>the key value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if
<em class="parameter"><code>keyval</code></em> is in lower case, or if
<em class="parameter"><code>keyval</code></em> is not subject to case
conversion.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_is_lower</code>() function
returns <code class="literal">True</code> if the key value specified by
<em class="parameter"><code>keyval</code></em> is in lower case or is not subject to case
conversion.</p></div><div class="refsect2" title="gtk.gdk.keyval_to_unicode"><a name="function-gdk--keyval-to-unicode"></a><h3>gtk.gdk.keyval_to_unicode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.keyval_to_unicode</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>keyval</code></strong> :</span></p></td><td>the key value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the corresponding unicode character, or 0 if
there is no corresponding character.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.keyval_to_unicode</code>() function
converts the key value specified by <em class="parameter"><code>keyval</code></em> to the
corresponding ISO10646 (Unicode) character.</p></div><div class="refsect2" title="gtk.gdk.unicode_to_keyval"><a name="function-gdk--unicode-to-keyval"></a><h3>gtk.gdk.unicode_to_keyval</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.unicode_to_keyval</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>wc</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>wc</code></strong> :</span></p></td><td> a ISO10646 encoded (unicode)
character</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the corresponding key value, if one exists. or,
if there is no corresponding symbol, <em class="parameter"><code>wc</code></em> |
0x01000000</td></tr></tbody></table><p>The <code class="function">gtk.gdk.unicode_to_keyval</code>() function
converts the ISO10646 (unicode) character specified by
<em class="parameter"><code>wc</code></em> to a key value.</p></div></div><div class="refsect1" title="Signals"><a name="id3335139"></a><h2>Signals</h2><div class="refsect2" title='The "direction-changed" gtk.gdk.Keymap Signal'><a name="signal-gdkkeymap--direction-changed"></a><h3>The "direction-changed" gtk.gdk.Keymap Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>gdkkeymap</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>gdkkeymap</code></em> :</span></p></td><td>the gdkkeymap that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "direction-changed" signal is emitted when the pango text
direction of <em class="parameter"><code>gdkkeymap</code></em> is changed</p></div><div class="refsect2" title='The "keys-changed" gtk.gdk.Keymap Signal'><a name="signal-gdkkeymap--keys-changed"></a><h3>The "keys-changed" gtk.gdk.Keymap Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>gdkkeymap</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>gdkkeymap</code></em> :</span></p></td><td>the gdkkeymap that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.2 and above.</p></div><p>The "keys-changed" signal is emitted when the mapping
represented by <em class="parameter"><code>keymap</code></em> changes.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkimage.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gdkpangorenderer.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.Image </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.gdk.PangoRenderer</td></tr></table></div></body></html>
|