4 (defparameter +keysym-code
+ "space 32 0x0020
65 bracketright 93 0x005d
99 nobreakspace 160 0x00a0
100 exclamdown 161 0x00a1
109 ordfeminine 170 0x00aa
110 guillemotleft 171 0x00ab
113 registered 174 0x00ae
117 twosuperior 178 0x00b2
118 threesuperior 179 0x00b3
122 periodcentered 183 0x00b7
124 onesuperior 185 0x00b9
126 guillemotright 187 0x00bb
127 onequarter 188 0x00bc
129 threequarters 190 0x00be
130 questiondown 191 0x00bf
133 Acircumflex 194 0x00c2
135 Adiaeresis 196 0x00c4
141 Ecircumflex 202 0x00ca
142 Ediaeresis 203 0x00cb
145 Icircumflex 206 0x00ce
146 Idiaeresis 207 0x00cf
151 Ocircumflex 212 0x00d4
153 Odiaeresis 214 0x00d6
158 Ucircumflex 219 0x00db
159 Udiaeresis 220 0x00dc
165 acircumflex 226 0x00e2
167 adiaeresis 228 0x00e4
173 ecircumflex 234 0x00ea
174 ediaeresis 235 0x00eb
177 icircumflex 238 0x00ee
178 idiaeresis 239 0x00ef
183 ocircumflex 244 0x00f4
185 odiaeresis 246 0x00f6
190 ucircumflex 251 0x00fb
191 udiaeresis 252 0x00fc
194 ydiaeresis 255 0x00ff
216 doubleacute 445 0x01bd
228 Odoubleacute 469 0x01d5
231 Udoubleacute 475 0x01db
242 odoubleacute 501 0x01f5
245 udoubleacute 507 0x01fb
249 Hcircumflex 678 0x02a6
252 Jcircumflex 684 0x02ac
254 hcircumflex 694 0x02b6
257 jcircumflex 700 0x02bc
259 Ccircumflex 710 0x02c6
261 Gcircumflex 728 0x02d8
263 Scircumflex 734 0x02de
265 ccircumflex 742 0x02e6
267 gcircumflex 760 0x02f8
269 scircumflex 766 0x02fe
297 eabovedot 1004 0x03ec
306 kana_fullstop 1185 0x04a1
307 kana_openingbracket 1186 0x04a2
308 kana_closingbracket 1187 0x04a3
309 kana_comma 1188 0x04a4
310 kana_middledot 1189 0x04a5
321 prolongedsound 1200 0x04b0
367 voicedsound 1246 0x04de
368 semivoicedsound 1247 0x04df
369 Arabic_comma 1452 0x05ac
370 Arabic_semicolon 1467 0x05bb
371 Arabic_question_mark 1471 0x05bf
372 Arabic_hamza 1473 0x05c1
373 Arabic_maddaonalef 1474 0x05c2
374 Arabic_hamzaonalef 1475 0x05c3
375 Arabic_hamzaonwaw 1476 0x05c4
376 Arabic_hamzaunderalef 1477 0x05c5
377 Arabic_hamzaonyeh 1478 0x05c6
378 Arabic_alef 1479 0x05c7
379 Arabic_beh 1480 0x05c8
380 Arabic_tehmarbuta 1481 0x05c9
381 Arabic_teh 1482 0x05ca
382 Arabic_theh 1483 0x05cb
383 Arabic_jeem 1484 0x05cc
384 Arabic_hah 1485 0x05cd
385 Arabic_khah 1486 0x05ce
386 Arabic_dal 1487 0x05cf
387 Arabic_thal 1488 0x05d0
388 Arabic_ra 1489 0x05d1
389 Arabic_zain 1490 0x05d2
390 Arabic_seen 1491 0x05d3
391 Arabic_sheen 1492 0x05d4
392 Arabic_sad 1493 0x05d5
393 Arabic_dad 1494 0x05d6
394 Arabic_tah 1495 0x05d7
395 Arabic_zah 1496 0x05d8
396 Arabic_ain 1497 0x05d9
397 Arabic_ghain 1498 0x05da
398 Arabic_tatweel 1504 0x05e0
399 Arabic_feh 1505 0x05e1
400 Arabic_qaf 1506 0x05e2
401 Arabic_kaf 1507 0x05e3
402 Arabic_lam 1508 0x05e4
403 Arabic_meem 1509 0x05e5
404 Arabic_noon 1510 0x05e6
405 Arabic_heh 1511 0x05e7
406 Arabic_waw 1512 0x05e8
407 Arabic_alefmaksura 1513 0x05e9
408 Arabic_yeh 1514 0x05ea
409 Arabic_fathatan 1515 0x05eb
410 Arabic_dammatan 1516 0x05ec
411 Arabic_kasratan 1517 0x05ed
412 Arabic_fatha 1518 0x05ee
413 Arabic_damma 1519 0x05ef
414 Arabic_kasra 1520 0x05f0
415 Arabic_shadda 1521 0x05f1
416 Arabic_sukun 1522 0x05f2
417 Serbian_dje 1697 0x06a1
418 Macedonia_gje 1698 0x06a2
419 Cyrillic_io 1699 0x06a3
420 Ukranian_je 1700 0x06a4
421 Macedonia_dse 1701 0x06a5
422 Ukranian_i 1702 0x06a6
423 Ukranian_yi 1703 0x06a7
424 Serbian_je 1704 0x06a8
425 Serbian_lje 1705 0x06a9
426 Serbian_nje 1706 0x06aa
427 Serbian_tshe 1707 0x06ab
428 Macedonia_kje 1708 0x06ac
429 Byelorussian_shortu 1710 0x06ae
430 Serbian_dze 1711 0x06af
431 numerosign 1712 0x06b0
432 Serbian_DJE 1713 0x06b1
433 Macedonia_GJE 1714 0x06b2
434 Cyrillic_IO 1715 0x06b3
435 Ukranian_JE 1716 0x06b4
436 Macedonia_DSE 1717 0x06b5
437 Ukranian_I 1718 0x06b6
438 Ukranian_YI 1719 0x06b7
439 Serbian_JE 1720 0x06b8
440 Serbian_LJE 1721 0x06b9
441 Serbian_NJE 1722 0x06ba
442 Serbian_TSHE 1723 0x06bb
443 Macedonia_KJE 1724 0x06bc
444 Byelorussian_SHORTU 1726 0x06be
445 Serbian_DZE 1727 0x06bf
446 Cyrillic_yu 1728 0x06c0
447 Cyrillic_a 1729 0x06c1
448 Cyrillic_be 1730 0x06c2
449 Cyrillic_tse 1731 0x06c3
450 Cyrillic_de 1732 0x06c4
451 Cyrillic_ie 1733 0x06c5
452 Cyrillic_ef 1734 0x06c6
453 Cyrillic_ghe 1735 0x06c7
454 Cyrillic_ha 1736 0x06c8
455 Cyrillic_i 1737 0x06c9
456 Cyrillic_shorti 1738 0x06ca
457 Cyrillic_ka 1739 0x06cb
458 Cyrillic_el 1740 0x06cc
459 Cyrillic_em 1741 0x06cd
460 Cyrillic_en 1742 0x06ce
461 Cyrillic_o 1743 0x06cf
462 Cyrillic_pe 1744 0x06d0
463 Cyrillic_ya 1745 0x06d1
464 Cyrillic_er 1746 0x06d2
465 Cyrillic_es 1747 0x06d3
466 Cyrillic_te 1748 0x06d4
467 Cyrillic_u 1749 0x06d5
468 Cyrillic_zhe 1750 0x06d6
469 Cyrillic_ve 1751 0x06d7
470 Cyrillic_softsign 1752 0x06d8
471 Cyrillic_yeru 1753 0x06d9
472 Cyrillic_ze 1754 0x06da
473 Cyrillic_sha 1755 0x06db
474 Cyrillic_e 1756 0x06dc
475 Cyrillic_shcha 1757 0x06dd
476 Cyrillic_che 1758 0x06de
477 Cyrillic_hardsign 1759 0x06df
478 Cyrillic_YU 1760 0x06e0
479 Cyrillic_A 1761 0x06e1
480 Cyrillic_BE 1762 0x06e2
481 Cyrillic_TSE 1763 0x06e3
482 Cyrillic_DE 1764 0x06e4
483 Cyrillic_IE 1765 0x06e5
484 Cyrillic_EF 1766 0x06e6
485 Cyrillic_GHE 1767 0x06e7
486 Cyrillic_HA 1768 0x06e8
487 Cyrillic_I 1769 0x06e9
488 Cyrillic_SHORTI 1770 0x06ea
489 Cyrillic_KA 1771 0x06eb
490 Cyrillic_EL 1772 0x06ec
491 Cyrillic_EM 1773 0x06ed
492 Cyrillic_EN 1774 0x06ee
493 Cyrillic_O 1775 0x06ef
494 Cyrillic_PE 1776 0x06f0
495 Cyrillic_YA 1777 0x06f1
496 Cyrillic_ER 1778 0x06f2
497 Cyrillic_ES 1779 0x06f3
498 Cyrillic_TE 1780 0x06f4
499 Cyrillic_U 1781 0x06f5
500 Cyrillic_ZHE 1782 0x06f6
501 Cyrillic_VE 1783 0x06f7
502 Cyrillic_SOFTSIGN 1784 0x06f8
503 Cyrillic_YERU 1785 0x06f9
504 Cyrillic_ZE 1786 0x06fa
505 Cyrillic_SHA 1787 0x06fb
506 Cyrillic_E 1788 0x06fc
507 Cyrillic_SHCHA 1789 0x06fd
508 Cyrillic_CHE 1790 0x06fe
509 Cyrillic_HARDSIGN 1791 0x06ff
510 Greek_ALPHAaccent 1953 0x07a1
511 Greek_EPSILONaccent 1954 0x07a2
512 Greek_ETAaccent 1955 0x07a3
513 Greek_IOTAaccent 1956 0x07a4
514 Greek_IOTAdiaeresis 1957 0x07a5
515 Greek_IOTAaccentdiaeresis 1958 0x07a6
516 Greek_OMICRONaccent 1959 0x07a7
517 Greek_UPSILONaccent 1960 0x07a8
518 Greek_UPSILONdieresis 1961 0x07a9
519 Greek_UPSILONaccentdieresis 1962 0x07aa
520 Greek_OMEGAaccent 1963 0x07ab
521 Greek_alphaaccent 1969 0x07b1
522 Greek_epsilonaccent 1970 0x07b2
523 Greek_etaaccent 1971 0x07b3
524 Greek_iotaaccent 1972 0x07b4
525 Greek_iotadieresis 1973 0x07b5
526 Greek_iotaaccentdieresis 1974 0x07b6
527 Greek_omicronaccent 1975 0x07b7
528 Greek_upsilonaccent 1976 0x07b8
529 Greek_upsilondieresis 1977 0x07b9
530 Greek_upsilonaccentdieresis 1978 0x07ba
531 Greek_omegaaccent 1979 0x07bb
532 Greek_ALPHA 1985 0x07c1
533 Greek_BETA 1986 0x07c2
534 Greek_GAMMA 1987 0x07c3
535 Greek_DELTA 1988 0x07c4
536 Greek_EPSILON 1989 0x07c5
537 Greek_ZETA 1990 0x07c6
538 Greek_ETA 1991 0x07c7
539 Greek_THETA 1992 0x07c8
540 Greek_IOTA 1993 0x07c9
541 Greek_KAPPA 1994 0x07ca
542 Greek_LAMBDA 1995 0x07cb
546 Greek_OMICRON 1999 0x07cf
548 Greek_RHO 2001 0x07d1
549 Greek_SIGMA 2002 0x07d2
550 Greek_TAU 2004 0x07d4
551 Greek_UPSILON 2005 0x07d5
552 Greek_PHI 2006 0x07d6
553 Greek_CHI 2007 0x07d7
554 Greek_PSI 2008 0x07d8
555 Greek_OMEGA 2009 0x07d9
556 Greek_alpha 2017 0x07e1
557 Greek_beta 2018 0x07e2
558 Greek_gamma 2019 0x07e3
559 Greek_delta 2020 0x07e4
560 Greek_epsilon 2021 0x07e5
561 Greek_zeta 2022 0x07e6
562 Greek_eta 2023 0x07e7
563 Greek_theta 2024 0x07e8
564 Greek_iota 2025 0x07e9
565 Greek_kappa 2026 0x07ea
566 Greek_lambda 2027 0x07eb
570 Greek_omicron 2031 0x07ef
572 Greek_rho 2033 0x07f1
573 Greek_sigma 2034 0x07f2
574 Greek_finalsmallsigma 2035 0x07f3
575 Greek_tau 2036 0x07f4
576 Greek_upsilon 2037 0x07f5
577 Greek_phi 2038 0x07f6
578 Greek_chi 2039 0x07f7
579 Greek_psi 2040 0x07f8
580 Greek_omega 2041 0x07f9
581 leftradical 2209 0x08a1
582 topleftradical 2210 0x08a2
583 horizconnector 2211 0x08a3
584 topintegral 2212 0x08a4
585 botintegral 2213 0x08a5
586 vertconnector 2214 0x08a6
587 topleftsqbracket 2215 0x08a7
588 botleftsqbracket 2216 0x08a8
589 toprightsqbracket 2217 0x08a9
590 botrightsqbracket 2218 0x08aa
591 topleftparens 2219 0x08ab
592 botleftparens 2220 0x08ac
593 toprightparens 2221 0x08ad
594 botrightparens 2222 0x08ae
595 leftmiddlecurlybrace 2223 0x08af
596 rightmiddlecurlybrace 2224 0x08b0
597 topleftsummation 2225 0x08b1
598 botleftsummation 2226 0x08b2
599 topvertsummationconnector 2227 0x08b3
600 botvertsummationconnector 2228 0x08b4
601 toprightsummation 2229 0x08b5
602 botrightsummation 2230 0x08b6
603 rightmiddlesummation 2231 0x08b7
604 lessthanequal 2236 0x08bc
606 greaterthanequal 2238 0x08be
608 therefore 2240 0x08c0
609 variation 2241 0x08c1
612 approximate 2248 0x08c8
613 similarequal 2249 0x08c9
616 identical 2255 0x08cf
618 includedin 2266 0x08da
620 intersection 2268 0x08dc
622 logicaland 2270 0x08de
623 logicalor 2271 0x08df
624 partialderivative 2287 0x08ef
626 leftarrow 2299 0x08fb
628 rightarrow 2301 0x08fd
629 downarrow 2302 0x08fe
631 soliddiamond 2528 0x09e0
632 checkerboard 2529 0x09e1
639 lowrightcorner 2538 0x09ea
640 uprightcorner 2539 0x09eb
641 upleftcorner 2540 0x09ec
642 lowleftcorner 2541 0x09ed
643 crossinglines 2542 0x09ee
644 horizlinescan1 2543 0x09ef
645 horizlinescan3 2544 0x09f0
646 horizlinescan5 2545 0x09f1
647 horizlinescan7 2546 0x09f2
648 horizlinescan9 2547 0x09f3
658 digitspace 2725 0x0aa5
659 punctspace 2726 0x0aa6
660 thinspace 2727 0x0aa7
661 hairspace 2728 0x0aa8
664 signifblank 2732 0x0aac
666 doubbaselinedot 2735 0x0aaf
668 twothirds 2737 0x0ab1
670 twofifths 2739 0x0ab3
671 threefifths 2740 0x0ab4
672 fourfifths 2741 0x0ab5
674 fivesixths 2743 0x0ab7
677 leftanglebracket 2748 0x0abc
678 decimalpoint 2749 0x0abd
679 rightanglebracket 2750 0x0abe
681 oneeighth 2755 0x0ac3
682 threeeighths 2756 0x0ac4
683 fiveeighths 2757 0x0ac5
684 seveneighths 2758 0x0ac6
685 trademark 2761 0x0ac9
686 signaturemark 2762 0x0aca
687 trademarkincircle 2763 0x0acb
688 leftopentriangle 2764 0x0acc
689 rightopentriangle 2765 0x0acd
690 emopencircle 2766 0x0ace
691 emopenrectangle 2767 0x0acf
692 leftsinglequotemark 2768 0x0ad0
693 rightsinglequotemark 2769 0x0ad1
694 leftdoublequotemark 2770 0x0ad2
695 rightdoublequotemark 2771 0x0ad3
696 prescription 2772 0x0ad4
699 latincross 2777 0x0ad9
701 filledrectbullet 2779 0x0adb
702 filledlefttribullet 2780 0x0adc
703 filledrighttribullet 2781 0x0add
704 emfilledcircle 2782 0x0ade
705 emfilledrect 2783 0x0adf
706 enopencircbullet 2784 0x0ae0
707 enopensquarebullet 2785 0x0ae1
708 openrectbullet 2786 0x0ae2
709 opentribulletup 2787 0x0ae3
710 opentribulletdown 2788 0x0ae4
712 enfilledcircbullet 2790 0x0ae6
713 enfilledsqbullet 2791 0x0ae7
714 filledtribulletup 2792 0x0ae8
715 filledtribulletdown 2793 0x0ae9
716 leftpointer 2794 0x0aea
717 rightpointer 2795 0x0aeb
721 maltesecross 2800 0x0af0
723 doubledagger 2802 0x0af2
724 checkmark 2803 0x0af3
725 ballotcross 2804 0x0af4
726 musicalsharp 2805 0x0af5
727 musicalflat 2806 0x0af6
728 malesymbol 2807 0x0af7
729 femalesymbol 2808 0x0af8
730 telephone 2809 0x0af9
731 telephonerecorder 2810 0x0afa
732 phonographcopyright 2811 0x0afb
734 singlelowquotemark 2813 0x0afd
735 doublelowquotemark 2814 0x0afe
737 leftcaret 2979 0x0ba3
738 rightcaret 2982 0x0ba6
739 downcaret 2984 0x0ba8
744 downstile 3012 0x0bc4
752 rightshoe 3032 0x0bd8
755 righttack 3068 0x0bfc
756 hebrew_aleph 3296 0x0ce0
757 hebrew_beth 3297 0x0ce1
758 hebrew_gimmel 3298 0x0ce2
759 hebrew_daleth 3299 0x0ce3
760 hebrew_he 3300 0x0ce4
761 hebrew_waw 3301 0x0ce5
762 hebrew_zayin 3302 0x0ce6
763 hebrew_het 3303 0x0ce7
764 hebrew_teth 3304 0x0ce8
765 hebrew_yod 3305 0x0ce9
766 hebrew_finalkaph 3306 0x0cea
767 hebrew_kaph 3307 0x0ceb
768 hebrew_lamed 3308 0x0cec
769 hebrew_finalmem 3309 0x0ced
770 hebrew_mem 3310 0x0cee
771 hebrew_finalnun 3311 0x0cef
772 hebrew_nun 3312 0x0cf0
773 hebrew_samekh 3313 0x0cf1
774 hebrew_ayin 3314 0x0cf2
775 hebrew_finalpe 3315 0x0cf3
776 hebrew_pe 3316 0x0cf4
777 hebrew_finalzadi 3317 0x0cf5
778 hebrew_zadi 3318 0x0cf6
779 hebrew_kuf 3319 0x0cf7
780 hebrew_resh 3320 0x0cf8
781 hebrew_shin 3321 0x0cf9
782 hebrew_taf 3322 0x0cfa
783 BackSpace 0008 0x0008
787 (defparameter *keysym-char
*
788 (loop with ht
= (make-hash-table :test
'eq
)
789 for line in
(ukt:split-sequence
#\Newline
+keysym-code
+)
790 for
(ksym dec nil
) = (ukt:split-sequence
#\space line
:remove-empty-subseqs t
)
791 do
;;(print (list (intern ksym :celtk) (code-char (parse-integer dec))))
792 (setf (gethash (intern ksym
:celtk
) ht
) (code-char (parse-integer dec
)))
793 finally
(return ht
)))
795 (defparameter *char-keysym
*
796 (loop with v
= (make-array 4000 :element-type
'fixnum
)
797 for line in
(ukt:split-sequence
#\Newline
+keysym-code
+)
798 for
(ksym dec nil
) = (ukt:split-sequence
#\space line
:remove-empty-subseqs t
)
799 do
(setf (aref v
(parse-integer dec
)) ksym
)
802 (ukt:export
! keysym-char
)
804 (defun keysym-char (keysym$
)
805 (gethash (intern keysym$
:celtk
) *keysym-char
*))
808 (gethash '|radical|
*keysym-char
*)
810 (defun char-keysym (char)
811 (aref *char-keysym
* (char-code char
)))
813 (defun char-code-keysym (char-code)
814 (aref *char-keysym
* char-code
))
818 Linefeed 65290 0xff0a
822 Scroll_Lock 65300 0xff14
825 Multi_key 65312 0xff20
850 Hebrew_switch 65406 0xff7e
851 Num_Lock 65407 0xff7f
852 KP_Space 65408 0xff80
854 KP_Enter 65421 0xff8d
859 KP_Multiply 65450 0xffaa
861 KP_Separator 65452 0xffac
862 KP_Subtract 65453 0xffad
863 KP_Decimal 65454 0xffae
864 KP_Divide 65455 0xffaf
875 KP_Equal 65469 0xffbd
913 Control_L 65507 0xffe3
914 Control_R 65508 0xffe4
915 Caps_Lock 65509 0xffe5
916 Shift_Lock 65510 0xffe6
924 Hyper_R 65518 0xffee"
929 ;;; ---- key symbols -------------------------------------------------------
931 ;;;(defparameter +keysym-chars+ '((minus . #\-)
933 ;;; (asciicircum . #\^)
935 ;;; (space . #\space)
936 ;;; (backspace . #\Backspace)
937 ;;; (delete . #\Delete)
939 ;;; (parenleft . #\()
940 ;;; (parenright . #\))
941 ;;; (bracketleft . #\[)
942 ;;; (bracketright . #\])
943 ;;; (braceleft . #\{)
944 ;;; (braceright . #\})
949 ;;; (backslash . #\\)
950 ;;; (asterisk . #\ยท)
954 (export! keysym-char keysym-sym minus period asciicircum plus backspace
955 delete bar parenleft parenright bracketleft
956 bracketright braceleft braceright less greater
957 slash backslash asterisk at tab
)
959 ;;;(defun tk-keysym-to-char (keysym)
960 ;;; (cdr (assoc keysym +keysym-chars+)))
962 ;;;(defun keysym-char (keysym$)
963 ;;; (or (tk-keysym-to-char (keysym-sym keysym$))
964 ;;; (when (= 1 (length keysym$))
965 ;;; (schar keysym$ 0))))
967 (defun keysym-sym (keysym$
)
968 (read-from-string (string-upcase keysym$
)))