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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Keyboard Handling: GDK 2 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK 2 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk2-Event-Structures.html" title="Event Structures">
<link rel="next" href="gdk2-Selections.html" title="Selections">
<meta name="generator" content="GTK-Doc V1.33.0 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#gdk2-Keyboard-Handling.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#gdk2-Keyboard-Handling.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_signals"> <span class="dim">|</span>
<a href="#gdk2-Keyboard-Handling.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gdk2-Event-Structures.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdk2-Selections.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk2-Keyboard-Handling"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk2-Keyboard-Handling.top_of_page"></a>Keyboard Handling</span></h2>
<p>Keyboard Handling</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="returnvalue">GdkKeymap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-default" title="gdk_keymap_get_default ()">gdk_keymap_get_default</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="returnvalue">GdkKeymap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()">gdk_keymap_get_for_display</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-lookup-key" title="gdk_keymap_lookup_key ()">gdk_keymap_lookup_key</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-translate-keyboard-state" title="gdk_keymap_translate_keyboard_state ()">gdk_keymap_translate_keyboard_state</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-entries-for-keyval" title="gdk_keymap_get_entries_for_keyval ()">gdk_keymap_get_entries_for_keyval</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-entries-for-keycode" title="gdk_keymap_get_entries_for_keycode ()">gdk_keymap_get_entries_for_keycode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/pango/pango-Bidirectional-Text.html#PangoDirection"><span class="returnvalue">PangoDirection</span></a>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-direction" title="gdk_keymap_get_direction ()">gdk_keymap_get_direction</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-have-bidi-layouts" title="gdk_keymap_have_bidi_layouts ()">gdk_keymap_have_bidi_layouts</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-caps-lock-state" title="gdk_keymap_get_caps_lock_state ()">gdk_keymap_get_caps_lock_state</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-add-virtual-modifiers" title="gdk_keymap_add_virtual_modifiers ()">gdk_keymap_add_virtual_modifiers</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-map-virtual-modifiers" title="gdk_keymap_map_virtual_modifiers ()">gdk_keymap_map_virtual_modifiers</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-name" title="gdk_keyval_name ()">gdk_keyval_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-from-name" title="gdk_keyval_from_name ()">gdk_keyval_from_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-convert-case" title="gdk_keyval_convert_case ()">gdk_keyval_convert_case</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-to-upper" title="gdk_keyval_to_upper ()">gdk_keyval_to_upper</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-to-lower" title="gdk_keyval_to_lower ()">gdk_keyval_to_lower</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-is-upper" title="gdk_keyval_is_upper ()">gdk_keyval_is_upper</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-is-lower" title="gdk_keyval_is_lower ()">gdk_keyval_is_lower</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint32</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-keyval-to-unicode" title="gdk_keyval_to_unicode ()">gdk_keyval_to_unicode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Keyboard-Handling.html#gdk-unicode-to-keyval" title="gdk_unicode_to_keyval ()">gdk_unicode_to_keyval</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signal_proto_type">
<col width="300px" class="signal_proto_name">
<col width="200px" class="signal_proto_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap-direction-changed" title="The “direction-changed” signal">direction-changed</a></td>
<td class="signal_flags">Run Last</td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap-keys-changed" title="The “keys-changed” signal">keys-changed</a></td>
<td class="signal_flags">Run Last</td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap-state-changed" title="The “state-changed” signal">state-changed</a></td>
<td class="signal_flags">Run Last</td>
</tr>
</tbody>
</table></div>
</div>
<a name="GdkKeymap"></a><div class="refsect1">
<a name="gdk2-Keyboard-Handling.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap-struct" title="struct GdkKeymap">GdkKeymap</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey">GdkKeymapKey</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> GObject
<span class="lineart">╰──</span> GdkKeymap
</pre>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <gdk/gdk.h>
</pre>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-keymap-get-default"></a><h3>gdk_keymap_get_default ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="returnvalue">GdkKeymap</span></a> *
gdk_keymap_get_default (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns the <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> attached to the default display.</p>
<div class="refsect3">
<a name="gdk-keymap-get-default.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>returns</p></td>
<td class="parameter_description"><p>the <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> attached to the default display.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-get-for-display"></a><h3>gdk_keymap_get_for_display ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="returnvalue">GdkKeymap</span></a> *
gdk_keymap_get_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>);</pre>
<p>Returns the <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> attached to <em class="parameter"><code>display</code></em>
.</p>
<div class="refsect3">
<a name="gdk-keymap-get-for-display.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>display</p></td>
<td class="parameter_description"><p>the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>returns</p></td>
<td class="parameter_description"><p>the <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> attached to <em class="parameter"><code>display</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-lookup-key"></a><h3>gdk_keymap_lookup_key ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
gdk_keymap_lookup_key (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>,
<em class="parameter"><code>const <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a> *key</code></em>);</pre>
<p>Looks up the keyval mapped to a keycode/group/level triplet.
If no keyval is bound to <em class="parameter"><code>key</code></em>
, returns 0. For normal user input,
you want to use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-translate-keyboard-state" title="gdk_keymap_translate_keyboard_state ()"><code class="function">gdk_keymap_translate_keyboard_state()</code></a> instead of
this function, since the effective group/level may not be
the same as the current keyboard state.</p>
<p>Note that passing <code class="literal">NULL</code> for <em class="parameter"><code>keymap</code></em>
is deprecated and will stop
to work in GTK+ 3.0. Use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()"><code class="function">gdk_keymap_get_for_display()</code></a> instead.</p>
<div class="refsect3">
<a name="gdk-keymap-lookup-key.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> or <code class="literal">NULL</code> to use the default keymap</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a> with keycode, group, and level initialized</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-lookup-key.returns"></a><h4>Returns</h4>
<p> a keyval, or 0 if none was mapped to the given <em class="parameter"><code>key</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-translate-keyboard-state"></a><h3>gdk_keymap_translate_keyboard_state ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keymap_translate_keyboard_state (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>,
<em class="parameter"><code><span class="type">guint</span> hardware_keycode</code></em>,
<em class="parameter"><code><a class="link" href="gdk2-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> state</code></em>,
<em class="parameter"><code><span class="type">gint</span> group</code></em>,
<em class="parameter"><code><span class="type">guint</span> *keyval</code></em>,
<em class="parameter"><code><span class="type">gint</span> *effective_group</code></em>,
<em class="parameter"><code><span class="type">gint</span> *level</code></em>,
<em class="parameter"><code><a class="link" href="gdk2-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> *consumed_modifiers</code></em>);</pre>
<p>Translates the contents of a <a class="link" href="gdk2-Event-Structures.html#GdkEventKey" title="struct GdkEventKey"><span class="type">GdkEventKey</span></a> into a keyval, effective
group, and level. Modifiers that affected the translation and
are thus unavailable for application use are returned in
<em class="parameter"><code>consumed_modifiers</code></em>
. See <a class="xref" href="">???</a> for an explanation of
groups and levels. The <em class="parameter"><code>effective_group</code></em>
is the group that was
actually used for the translation; some keys such as Enter are not
affected by the active keyboard group. The <em class="parameter"><code>level</code></em>
is derived from
<em class="parameter"><code>state</code></em>
. For convenience, <a class="link" href="gdk2-Event-Structures.html#GdkEventKey" title="struct GdkEventKey"><span class="type">GdkEventKey</span></a> already contains the translated
keyval, so this function isn't as useful as you might think.</p>
<div class="note">
<p>
<em class="parameter"><code>consumed_modifiers</code></em> gives 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 <code class="literal">plus</code>
symbol is shifted, so when comparing a key press to a
<code class="literal"><Control>plus</code> accelerator <Shift> should
be masked out.
</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="cm">/* We want to ignore irrelevant modifiers like ScrollLock */</span>
<span class="cp">#define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)</span>
<span class="n">gdk_keymap_translate_keyboard_state</span> <span class="p">(</span><span class="n">keymap</span><span class="p">,</span> <span class="n">event</span><span class="o">-></span><span class="n">hardware_keycode</span><span class="p">,</span>
<span class="n">event</span><span class="o">-></span><span class="n">state</span><span class="p">,</span> <span class="n">event</span><span class="o">-></span><span class="n">group</span><span class="p">,</span>
<span class="o">&</span><span class="n">keyval</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&</span><span class="n">consumed</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">keyval</span> <span class="o">==</span> <span class="n">GDK_PLUS</span> <span class="o">&&</span>
<span class="p">(</span><span class="n">event</span><span class="o">-></span><span class="n">state</span> <span class="o">&</span> <span class="o">~</span><span class="n">consumed</span> <span class="o">&</span> <span class="n">ALL_ACCELS_MASK</span><span class="p">)</span> <span class="o">==</span> <span class="n">GDK_CONTROL_MASK</span><span class="p">)</span>
<span class="cm">/* Control was pressed */</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
An older interpretation <em class="parameter"><code>consumed_modifiers</code></em> was that it contained
all modifiers that might affect the translation of the key;
this allowed accelerators to be stored with irrelevant consumed
modifiers, by doing:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="cm">/* XXX Don't do this XXX */</span>
<span class="k">if</span> <span class="p">(</span><span class="n">keyval</span> <span class="o">==</span> <span class="n">accel_keyval</span> <span class="o">&&</span>
<span class="p">(</span><span class="n">event</span><span class="o">-></span><span class="n">state</span> <span class="o">&</span> <span class="o">~</span><span class="n">consumed</span> <span class="o">&</span> <span class="n">ALL_ACCELS_MASK</span><span class="p">)</span> <span class="o">==</span> <span class="p">(</span><span class="n">accel_mods</span> <span class="o">&</span> <span class="o">~</span><span class="n">consumed</span><span class="p">))</span>
<span class="cm">/* Accelerator was pressed */</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
However, this did not work if multi-modifier combinations were
used in the keymap, since, for instance, <code class="literal"><Control></code>
would be masked out even if only <code class="literal"><Control><Alt></code>
was used in the keymap. To support this usage as well as well as
possible, all <span class="emphasis"><em>single modifier</em></span> combinations
that could affect the key for any combination of modifiers will
be returned in <em class="parameter"><code>consumed_modifiers</code></em>; 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 <code class="literal"><Control>plus</code>,
not <code class="literal"><Control><Shift>plus</code>,
</p>
</div>
<p>Note that passing <code class="literal">NULL</code> for <em class="parameter"><code>keymap</code></em>
is deprecated and will stop
to work in GTK+ 3.0. Use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()"><code class="function">gdk_keymap_get_for_display()</code></a> instead.</p>
<div class="refsect3">
<a name="gdk-keymap-translate-keyboard-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a>, or <code class="literal">NULL</code> to use the default. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>hardware_keycode</p></td>
<td class="parameter_description"><p>a keycode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>a modifier state</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>group</p></td>
<td class="parameter_description"><p>active keyboard group</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>keyval</p></td>
<td class="parameter_description"><p>return location for keyval, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>effective_group</p></td>
<td class="parameter_description"><p>return location for effective group, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>level</p></td>
<td class="parameter_description"><p>return location for level, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>consumed_modifiers</p></td>
<td class="parameter_description"><p>return location for modifiers that were used to
determine the group or level, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-translate-keyboard-state.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if there was a keyval bound to the keycode/state/group</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-get-entries-for-keyval"></a><h3>gdk_keymap_get_entries_for_keyval ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keymap_get_entries_for_keyval (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>,
<em class="parameter"><code><span class="type">guint</span> keyval</code></em>,
<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a> **keys</code></em>,
<em class="parameter"><code><span class="type">gint</span> *n_keys</code></em>);</pre>
<p>Obtains a list of keycode/group/level combinations 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.
<a class="link" href="gdk2-Event-Structures.html#GdkEventKey" title="struct GdkEventKey"><span class="type">GdkEventKey</span></a> contains a <code class="literal">group</code> field that indicates the active
keyboard group. The level is computed from the modifier mask.
The returned array should be freed
with <code class="function">g_free()</code>.</p>
<p>Note that passing <code class="literal">NULL</code> for <em class="parameter"><code>keymap</code></em>
is deprecated and will stop
to work in GTK+ 3.0. Use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()"><code class="function">gdk_keymap_get_for_display()</code></a> instead.</p>
<div class="refsect3">
<a name="gdk-keymap-get-entries-for-keyval.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a>, or <code class="literal">NULL</code> to use the default keymap. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>keyval</p></td>
<td class="parameter_description"><p>a keyval, such as <code class="literal">GDK_a</code>, <code class="literal">GDK_Up</code>, <code class="literal">GDK_Return</code>, etc.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>keys</p></td>
<td class="parameter_description"><p>return location for an array of <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_keys</p></td>
<td class="parameter_description"><p>return location for number of elements in returned array. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-get-entries-for-keyval.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if keys were found and returned</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-get-entries-for-keycode"></a><h3>gdk_keymap_get_entries_for_keycode ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keymap_get_entries_for_keycode (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>,
<em class="parameter"><code><span class="type">guint</span> hardware_keycode</code></em>,
<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a> **keys</code></em>,
<em class="parameter"><code><span class="type">guint</span> **keyvals</code></em>,
<em class="parameter"><code><span class="type">gint</span> *n_entries</code></em>);</pre>
<p>Returns the keyvals bound to <em class="parameter"><code>hardware_keycode</code></em>
.
The Nth <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a> in <em class="parameter"><code>keys</code></em>
is bound to the Nth
keyval in <em class="parameter"><code>keyvals</code></em>
. Free the returned arrays with <code class="function">g_free()</code>.
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 <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-translate-keyboard-state" title="gdk_keymap_translate_keyboard_state ()"><code class="function">gdk_keymap_translate_keyboard_state()</code></a>.</p>
<p>Note that passing <code class="literal">NULL</code> for <em class="parameter"><code>keymap</code></em>
is deprecated and will stop
to work in GTK+ 3.0. Use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()"><code class="function">gdk_keymap_get_for_display()</code></a> instead.</p>
<div class="refsect3">
<a name="gdk-keymap-get-entries-for-keycode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> or <code class="literal">NULL</code> to use the default keymap. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>hardware_keycode</p></td>
<td class="parameter_description"><p>a keycode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>keys</p></td>
<td class="parameter_description"><p>return location for array of <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymapKey" title="struct GdkKeymapKey"><span class="type">GdkKeymapKey</span></a>, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>keyvals</p></td>
<td class="parameter_description"><p>return location for array of keyvals, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_entries</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>keys</code></em>
and <em class="parameter"><code>keyvals</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-get-entries-for-keycode.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if there were any entries</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-get-direction"></a><h3>gdk_keymap_get_direction ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/pango/pango-Bidirectional-Text.html#PangoDirection"><span class="returnvalue">PangoDirection</span></a>
gdk_keymap_get_direction (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>);</pre>
<p>Returns the direction of effective layout of the keymap.</p>
<p>Note that passing <code class="literal">NULL</code> for <em class="parameter"><code>keymap</code></em>
is deprecated and will stop
to work in GTK+ 3.0. Use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()"><code class="function">gdk_keymap_get_for_display()</code></a> instead.</p>
<div class="refsect3">
<a name="gdk-keymap-get-direction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> or <code class="literal">NULL</code> to use the default keymap</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-get-direction.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-LTR:CAPS"><code class="literal">PANGO_DIRECTION_LTR</code></a> or <a href="https://developer.gnome.org/pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-RTL:CAPS"><code class="literal">PANGO_DIRECTION_RTL</code></a>
if it can determine the direction. <a href="https://developer.gnome.org/pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-NEUTRAL:CAPS"><code class="literal">PANGO_DIRECTION_NEUTRAL</code></a>
otherwise.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-have-bidi-layouts"></a><h3>gdk_keymap_have_bidi_layouts ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keymap_have_bidi_layouts (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>);</pre>
<p>Determines if keyboard layouts for both right-to-left and left-to-right
languages are in use.</p>
<p>Note that passing <code class="literal">NULL</code> for <em class="parameter"><code>keymap</code></em>
is deprecated and will stop
to work in GTK+ 3.0. Use <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-for-display" title="gdk_keymap_get_for_display ()"><code class="function">gdk_keymap_get_for_display()</code></a> instead.</p>
<div class="refsect3">
<a name="gdk-keymap-have-bidi-layouts.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> or <code class="literal">NULL</code> to use the default keymap</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-have-bidi-layouts.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if there are layouts in both directions, <code class="literal">FALSE</code> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-12.html#api-index-2.12">2.12</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-get-caps-lock-state"></a><h3>gdk_keymap_get_caps_lock_state ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keymap_get_caps_lock_state (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>);</pre>
<p>Returns whether the Caps Lock modifer is locked.</p>
<div class="refsect3">
<a name="gdk-keymap-get-caps-lock-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-get-caps-lock-state.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if Caps Lock is on</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-16.html#api-index-2.16">2.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-add-virtual-modifiers"></a><h3>gdk_keymap_add_virtual_modifiers ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_keymap_add_virtual_modifiers (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>,
<em class="parameter"><code><a class="link" href="gdk2-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>);</pre>
<p>Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond
to the real modifiers (i.e Mod2, Mod3, ...) in <em class="parameter"><code>modifiers</code></em>
.
are set in <em class="parameter"><code>state</code></em>
to their non-virtual counterparts (i.e. Mod2,
Mod3,...) and set the corresponding bits in <em class="parameter"><code>state</code></em>
.</p>
<p>GDK already does this before delivering key events, but for
compatibility reasons, it only sets the first virtual modifier
it finds, whereas this function sets all matching virtual modifiers.</p>
<p>This function is useful when matching key events against
accelerators.</p>
<div class="refsect3">
<a name="gdk-keymap-add-virtual-modifiers.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>pointer to the modifier mask to change</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-20.html#api-index-2.20">2.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keymap-map-virtual-modifiers"></a><h3>gdk_keymap_map_virtual_modifiers ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keymap_map_virtual_modifiers (<em class="parameter"><code><a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap</code></em>,
<em class="parameter"><code><a class="link" href="gdk2-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>);</pre>
<p>Maps the virtual modifiers (i.e. Super, Hyper and Meta) which
are set in <em class="parameter"><code>state</code></em>
to their non-virtual counterparts (i.e. Mod2,
Mod3,...) and set the corresponding bits in <em class="parameter"><code>state</code></em>
.</p>
<p>This function is useful when matching key events against
accelerators.</p>
<div class="refsect3">
<a name="gdk-keymap-map-virtual-modifiers.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>pointer to the modifier state to map</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keymap-map-virtual-modifiers.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if no virtual modifiers were mapped to the
same non-virtual modifier. Note that <code class="literal">FALSE</code> is also returned
if a virtual modifier is mapped to a non-virtual modifier that
was already set in <em class="parameter"><code>state</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-20.html#api-index-2.20">2.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-name"></a><h3>gdk_keyval_name ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
gdk_keyval_name (<em class="parameter"><code><span class="type">guint</span> keyval</code></em>);</pre>
<p>Converts a key value into a symbolic name.</p>
<p>The names are the same as those in the
<code class="filename"><gdk/gdkkeysyms.h></code> header file
but without the leading "GDK_KEY_".</p>
<div class="refsect3">
<a name="gdk-keyval-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>keyval</p></td>
<td class="parameter_description"><p>a key value</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keyval-name.returns"></a><h4>Returns</h4>
<p>a string containing the name of the key,
or <code class="literal">NULL</code> if <em class="parameter"><code>keyval</code></em>
is not a valid key. The string should not be
modified. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-from-name"></a><h3>gdk_keyval_from_name ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
gdk_keyval_from_name (<em class="parameter"><code>const <span class="type">gchar</span> *keyval_name</code></em>);</pre>
<p>Converts a key name to a key value.</p>
<p>The names are the same as those in the
<code class="filename"><gdk/gdkkeysyms.h></code> header file
but without the leading "GDK_KEY_".</p>
<div class="refsect3">
<a name="gdk-keyval-from-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>keyval_name</p></td>
<td class="parameter_description"><p>a key name</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keyval-from-name.returns"></a><h4>Returns</h4>
<p> the corresponding key value, or <code class="literal">GDK_KEY_VoidSymbol</code>
if the key name is not a valid key</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-convert-case"></a><h3>gdk_keyval_convert_case ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_keyval_convert_case (<em class="parameter"><code><span class="type">guint</span> symbol</code></em>,
<em class="parameter"><code><span class="type">guint</span> *lower</code></em>,
<em class="parameter"><code><span class="type">guint</span> *upper</code></em>);</pre>
<p>Obtains the upper- and lower-case versions of the keyval <em class="parameter"><code>symbol</code></em>
.
Examples of keyvals are <span class="type">GDK_a</span>, <span class="type">GDK_Enter</span>, <span class="type">GDK_F1</span>, etc.</p>
<div class="refsect3">
<a name="gdk-keyval-convert-case.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>symbol</p></td>
<td class="parameter_description"><p>a keyval</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>lower</p></td>
<td class="parameter_description"><p>return location for lowercase version of <em class="parameter"><code>symbol</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>upper</p></td>
<td class="parameter_description"><p>return location for uppercase version of <em class="parameter"><code>symbol</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-to-upper"></a><h3>gdk_keyval_to_upper ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
gdk_keyval_to_upper (<em class="parameter"><code><span class="type">guint</span> keyval</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-to-lower"></a><h3>gdk_keyval_to_lower ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
gdk_keyval_to_lower (<em class="parameter"><code><span class="type">guint</span> keyval</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-is-upper"></a><h3>gdk_keyval_is_upper ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keyval_is_upper (<em class="parameter"><code><span class="type">guint</span> keyval</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-is-lower"></a><h3>gdk_keyval_is_lower ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_keyval_is_lower (<em class="parameter"><code><span class="type">guint</span> keyval</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyval-to-unicode"></a><h3>gdk_keyval_to_unicode ()</h3>
<pre class="programlisting"><span class="returnvalue">guint32</span>
gdk_keyval_to_unicode (<em class="parameter"><code><span class="type">guint</span> keyval</code></em>);</pre>
<p>Convert from a GDK key symbol to the corresponding ISO10646 (Unicode)
character.</p>
<div class="refsect3">
<a name="gdk-keyval-to-unicode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>keyval</p></td>
<td class="parameter_description"><p>a GDK key symbol </p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-keyval-to-unicode.returns"></a><h4>Returns</h4>
<p> the corresponding unicode character, or 0 if there
is no corresponding character.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-unicode-to-keyval"></a><h3>gdk_unicode_to_keyval ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
gdk_unicode_to_keyval (<em class="parameter"><code><span class="type">guint32</span> wc</code></em>);</pre>
<p>Convert from a ISO10646 character to a key symbol.</p>
<div class="refsect3">
<a name="gdk-unicode-to-keyval.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>wc</p></td>
<td class="parameter_description"><p>a ISO10646 encoded character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-unicode-to-keyval.returns"></a><h4>Returns</h4>
<p> the corresponding GDK key symbol, if one exists.
or, if there is no corresponding symbol,
wc | 0x01000000</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GdkKeymap-struct"></a><h3>struct GdkKeymap</h3>
<pre class="programlisting">struct GdkKeymap;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GdkKeymapKey"></a><h3>struct GdkKeymapKey</h3>
<pre class="programlisting">struct GdkKeymapKey {
guint keycode;
gint group;
gint level;
};
</pre>
</div>
</div>
<div class="refsect1">
<a name="gdk2-Keyboard-Handling.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GdkKeymap-direction-changed"></a><h3>The <code class="literal">“direction-changed”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap,
<span class="type">gpointer</span> user_data)</pre>
<p>The ::direction-changed signal gets emitted when the direction of
the keymap changes.</p>
<div class="refsect3">
<a name="GdkKeymap-direction-changed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>the object on which the signal is emitted</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run Last</p>
<p class="since">Since: 2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GdkKeymap-keys-changed"></a><h3>The <code class="literal">“keys-changed”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap,
<span class="type">gpointer</span> user_data)</pre>
<p>The ::keys-changed signal is emitted when the mapping represented by
<em class="parameter"><code>keymap</code></em>
changes.</p>
<div class="refsect3">
<a name="GdkKeymap-keys-changed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>the object on which the signal is emitted</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run Last</p>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GdkKeymap-state-changed"></a><h3>The <code class="literal">“state-changed”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="gdk2-Keyboard-Handling.html#GdkKeymap"><span class="type">GdkKeymap</span></a> *keymap,
<span class="type">gpointer</span> user_data)</pre>
<p>The ::state-changed signal is emitted when the state of the
keyboard changes, e.g when Caps Lock is turned on or off.
See <a class="link" href="gdk2-Keyboard-Handling.html#gdk-keymap-get-caps-lock-state" title="gdk_keymap_get_caps_lock_state ()"><code class="function">gdk_keymap_get_caps_lock_state()</code></a>.</p>
<div class="refsect3">
<a name="GdkKeymap-state-changed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>keymap</p></td>
<td class="parameter_description"><p>the object on which the signal is emitted</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run Last</p>
<p class="since">Since: <a class="link" href="api-index-2-16.html#api-index-2.16">2.16</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.0</div>
</body>
</html>
|