;; Copyright (c) 2001-2003 by David Frese ;; a keysym is a 16-bit protocol ID (see X11/keysymdef.h) ;; a keycode is an integer specifying a single key on the keyboard ;; (hardware depended) ;; *** manipulate keyboard encoding ********************************** ;; a keyboard mapping is a list of lists of keysyms (import-lambda-definition change-keyboard-mapping (display first-keycode keysyms-lists) "scx_Change_Keyboard_Mapping") ;; returns keycode-count lists of keysyms (import-lambda-definition get-keyboard-mapping (display first-keycode keycode-count) "scx_Get_Keyboard_Mapping") ;; returns a pair (min-keycodes . max-keycodes) (import-lambda-definition display-keycodes (display) "scx_Display_Keycodes") ;; a modmap is an alist mapping a modifier to a list of ;; keycodes. Valid modifiers are (state shift) (state lock) (state ;; control) (state mod1) (state mod2) (state mod3) (state mod4) ;; (state mod5) (import-lambda-definition set-modifier-mapping (display modmap) "scx_Set_Modifier_Mapping") (import-lambda-definition get-modifier-mapping (display) "scx_Get_Modifier_Mapping") ;; *** convert keysyms *********************************************** (import-lambda-definition string->keysym (string) "scx_String_To_Keysym") (import-lambda-definition keysym->string (keysym) "scx_Keysym_To_String") ;; TODO include X11/keysymdef.h ?? (import-lambda-definition keycode->keysym (display keycode index) "scx_Keycode_To_Keysym") (import-lambda-definition keysym->keycode (display keysym) "scx_Keysym_To_Keycode") ;; returns a pair (lower . upper) (import-lambda-definition convert-case (keysym) "scx_Convert_Case") (define (convert-to-lowercase keysym) (car (convert-case keysym))) (define (convert-to-uppercase keysym) (cdr (convert-case keysym))) ;; *** handle keyboard input events in Latin-1 *********************** (import-lambda-definition lookup-keysym (key-event index) "scx_Lookup_Keysym") (import-lambda-definition refresh-keyboard-mapping (mapping-event) "scx_Refresh_Keyboard_Mapping") ;; returns a pair (keysym . string) (import-lambda-definition lookup-string/keysym (key-event) "scx_Lookup_String") (define (lookup-string key-event) (cdr (lookup-string/keysym key-event))) (import-lambda-definition rebind-keysym (display keysym mod-keysyms string) "scx_Rebind_Keysym")