2001-10-04 08:21:25 -04:00
|
|
|
;; for display-min/max-keycode see XDisplayKeycodes.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (display-min-keycode display)
|
|
|
|
(%display-min-keycode (display-Xdisplay display)))
|
|
|
|
|
|
|
|
(import-lambda-definition %display-min-keycode (Xdisplay)
|
|
|
|
"scx_Display_Min_Keycode")
|
|
|
|
|
|
|
|
(define (display-max-keycode display)
|
|
|
|
(%display-max-keycode (display-Xdisplay display)))
|
|
|
|
|
|
|
|
(import-lambda-definition %display-max-keycode (Xdisplay)
|
|
|
|
"scx_Display_Max_Keycode")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; display-keysyms-per-keycode returns the number of keysyms per
|
|
|
|
;; keycode. See XGetKeyboardMapping.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (display-keysyms-per-keycode display)
|
|
|
|
(%display-keysyms-per-keycode (display-Xdisplay display)))
|
|
|
|
|
|
|
|
(import-lambda-definition %display-keysyms-per-keycode (Xdisplay)
|
|
|
|
"scx_Display_Keysyms_Per_Keycode")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; Standard KeySym names are obtained from <X11/keysymdef.h> by
|
|
|
|
;; removing the XK_ prefix from each name. But there may also be
|
|
|
|
;; implementation dependand names. See XStringToKeysym or
|
|
|
|
;; XKeysymToString.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (string->keysym string)
|
|
|
|
(%string->keysym (if (symbol? string)
|
|
|
|
(symbol->string string)
|
|
|
|
string)))
|
|
|
|
|
|
|
|
(import-lambda-definition %string->keysym (s)
|
|
|
|
"scx_String_To_Keysym")
|
|
|
|
|
|
|
|
(define (keysym->string keysym)
|
|
|
|
(%keysym->string keysym))
|
|
|
|
|
|
|
|
(import-lambda-definition %keysym->string (k)
|
|
|
|
"scx_Keysym_To_String")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; keycode->keysym uses internal Xlib tables to return the KeySym
|
|
|
|
;; defined for the specified KeyCode. If no symbol is defined false is
|
|
|
|
;; returned. See XKeycodeToKeysym.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (keycode->keysym display keycode index)
|
|
|
|
(%keycode->keysym (display-Xdisplay display)
|
|
|
|
keycode index))
|
|
|
|
|
|
|
|
(import-lambda-definition %keycode->keysym (Xdisplay kc i)
|
|
|
|
"scx_Keycode_To_Keysym")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; keysym->keycode returns the defined keycode for the specified
|
|
|
|
;; keysym. If the keysym is not defined then 0 is returned. See
|
|
|
|
;; XKeysymToKeycode.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (keysym->keycode display keysym)
|
|
|
|
(%keysym->keycode (display-Xdisplay display)
|
|
|
|
keysym))
|
|
|
|
|
|
|
|
(import-lambda-definition %keysym->keycode (Xdisplay ks)
|
|
|
|
"scx_Keysym_To_Keycode")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; lookup-string translates a keycode and a modifier mask, as obtained
|
|
|
|
;; from a key event, to a key name (like the ones returned by
|
|
|
|
;; keysym->string). See XLookupString.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (lookup-string display keycode mask)
|
|
|
|
(%lookup-string (display-Xdisplay display)
|
|
|
|
keycode mask))
|
|
|
|
|
|
|
|
(import-lambda-definition %lookup-string (Xdisplay kc m)
|
|
|
|
"scx_Lookup_String")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; rebind-keysym rebinds the meaning of a keysym/modifier pair for the
|
|
|
|
;; client. It does not redefine any key in the X server. lookup-string
|
|
|
|
;; returns this string afterwards. See XRebindKeysym.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (rebind-keysym display keysym modifiers string)
|
|
|
|
(%rebind-keysym (display-Xdisplay display)
|
|
|
|
keysym
|
|
|
|
(list->vector modifiers)
|
|
|
|
string))
|
|
|
|
|
|
|
|
(import-lambda-definition %rebind-keysym (Xdisplay ks mods str)
|
|
|
|
"scx_Rebind_Keysym")
|
|
|
|
|
2001-10-04 08:21:25 -04:00
|
|
|
;; refresh-keyboard-mapping refreshes the stored modifier and keymap
|
|
|
|
;; information. You usually call this function when a MappingNotify
|
|
|
|
;; event with a request member of MappingKeyboard or MappingModifier
|
|
|
|
;; occurs. The result is to update Xlib's knowledge of the
|
|
|
|
;; keyboard. See XRefreshKeyboardMapping.
|
|
|
|
|
2001-08-22 07:50:05 -04:00
|
|
|
(define (refresh-keyboard-mapping window type)
|
|
|
|
(%refresh-keyboard-mapping (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
type))
|
|
|
|
|
|
|
|
(import-lambda-definition %refresh-keyboard-mapping (Xdisplay Xwindow type)
|
2001-10-04 08:21:25 -04:00
|
|
|
"scx_Refresh_Keyboard_Mapping")
|