Next: Keyboard Encodings, Previous: Pointer Control, Up: Control Functions [Contents][Index]
The following paragraphs describe the CLX functions used to:
A display.
An integer (-100 through 100).
Rings the bell on the keyboard at a volume relative to the base volume for the keyboard, if possible. Percent can range from -100 to 100 inclusive, or else a Value error occurs. The following is the bell volume when percent is non-negative:
(- (+ base percent) (quotient (* base percent) 100))
and when percent is negative:
(+ base (quotient (* base percent) 100))
A display.
An integer (0 100).
An integer (0 100).
A card16.
A card16.
A card8.
Either :on or :off.
A card8 keycode.
Either :on, :off, or :default.
Changes the various aspects of the keyboard. The keyword arguments specify which controls to change.
The :key-click-percent keyword sets the volume for key clicks, if possible. A value of 0 implies off, while a value of 100 implies loud. Setting :key-click-percent to :default restores the default value.
The :bell-percent sets the base volume for the bell between 0 (off) and 100 (loud) if possible. Setting :bell-percent to :default restores the default value.
The :bell-pitch sets the pitch (specified in Hz) of the bell, if possible. Setting the :bell-pitch to :default restores the default value. The :bell-duration sets the duration ( specified in milliseconds) of the bell, if possible. Setting :bell-pitch to :default restores the default. Note that a bell generator connected with the console but not directly on the keyboard is treated as if it were part of the keyboard.
If both :led-mode and :led are specified, then the state of that LED is changed, if possible. If only :led-mode is specified, the state of all LEDs are changed, if possible. At most 32 LEDs are supported, numbered from one. No standard interpretation of the LEDs are defined.
If both :auto-repeat-mode and :key are specified, the auto-repeat mode of that key is changed, if possible. If only :auto-repeat-mode is specified, the global auto-repeat mode for the entire keyboard is changed, if possible, without affecting the per-key settings. An error occurs if :key is specified without :auto-repeat-mode.
A display.
Returns the current control values for the keyboard. For the LEDs, the least significant bit of led-mask corresponds to LED one, and each one bit in led-mask indicates an LED that is lit. auto-repeats is a bit vector; each one bit indicates that auto-repeat is enabled for the corresponding key. The vector is represented as 32 bytes. Byte n (from 0) contains the bits for keys 8n to 8n+7, with the least significant bit in the byte representing key 8n.
Type card8.
Type card16.
Type card32.
Either :on or :off.
Type bit-vector.
A display.
Returns the set of keycodes used for each modifier on the display keyboard. Each return value is a list of the card8 keycodes used for each modifier key. The order of keycodes within each list is server-dependent.
Type list of card8.
Some servers may include the same keycode in more than one list. For example, if the CAPS LOCK key has been turned into an additional CONTROL key, some servers include it in the third return value, but also in the second return value. Client code can therefore not rely on the returned lists to have pairwise empty intersections.
A display.
Returns a bit vector that describes the state of the keyboard. Each one bit indicates that the corresponding key is currently pressed. The vector is represented as 32 bytes. Byte n (from 0) contains the bits for keys 8n to 8n+7, with the least significant bit in the byte representing key 8n.
Type bit-vector 256.
A display.
A sequence of card8 keycodes for the given modifier.
Changes the set of keycodes mapped to the specified modifier keys on the display keyboard. Each keyword argument contains a sequence of new card8 keycodes for a specific modifier. The return value indicates whether the change was completed successfully.
A status of :failed is returned if hardware limitations prevent the requested change. For example, multiple keycodes per modifier may not be supported, up transitions on a given keycode may not be supported, or autorepeat may be mandatory for a given keycode. If :failed is returned, the mappings for all modifiers remain unchanged.
A status of :device-busy is returned if a new keycode given for a modifier was not previously mapped to that modifier and is currently in the down state. In this case, the mappings for all modifiers remain unchanged.
One of :success, :failed, or :device-busy.
Notice that the default value for each of the key arguments is the empty list. Failing to include a key argument in a call to this function will therefore remove all the keycodes as modifiers that were previously considered modifiers in the category corresponding to the keyword argument.
Next: Keyboard Encodings, Previous: Pointer Control, Up: Control Functions [Contents][Index]