Passa al contenuto principale

Requests: Extensions, Keyboard and Pointer Control

QueryBestSize​

class: {Cursor, Tile, Stipple}
drawable: DRAWABLE
width, height: CARD16

=>

width, height: CARD16
Errors: Drawable, Value, Match

Returns the "best" size that is "closest" to the argument size. For Cursor, this is the largest size that can be fully displayed. For Tile, this is the size that can be tiled "fastest". For Stipple, this is the size that can be stippled "fastest".

For Cursor, the drawable indicates the desired screen. For Tile and Stipple, the drawable indicates screen, and also possibly window class and depth; an InputOnly window cannot be used as the drawable for Tile or Stipple (else a Match error).

QueryExtension​

name: STRING8

=>

present: BOOL
major-opcode: CARD8
first-event: CARD8
first-error: CARD8

Determines if the named extension is present. If so, the major opcode for the extension is returned, if it has one, otherwise zero is returned. Any minor opcode and the request formats are specific to the extension. If the extension involves additional event types, the base event type code is returned, otherwise zero is returned. The format of the events is specific to the extension. If the extension involves additional error codes, the base error code is returned, otherwise zero is returned. The format of additional data in the errors is specific to the extension.

The extension name should be in the ASCII encoding, and upper/lower case matters.

ListExtensions​

=>

names: LISTofSTRING8

Returns a list of all extensions supported by the server.

SetKeyboardMapping​

map: LISTofCARD8

=>

status: {Success, Busy}
Errors: Value

Sets the mapping of the keyboard. Elements of the list are indexed starting from one. The list must be of length 255. The index is a "core" keycode, and the element of the list defines the "effective" keycode.

A zero element disables a key, no elements can have values 1 through 7, and no two elements (with index larger than 7) can have the same non-zero value. If the keyboard does not really generate a given keycode, specifying a non-zero value for that core keycode has no effect.

Elements 6 and 7 of the map must always be zero. The first five elements are special: they specify the keycodes (if any) that correspond to the Mod1 through Mod5 modifiers. Setting one of these entries to zero disables use of that modifier bit. No two of the firstfive elements can have the same non-zero value.

A server can impose restrictions on how keyboards get remapped, e.g., if certain keys do not generate up transitions in hardware.

If any of the keys or modifiers to be altered are currently in the down state, the status reply is Busy and the mapping is not changed.

GetKeyboardMapping​

=>

map: LISTofCARD8
Errors: Value

Returns the current mapping of the keyboard. Elements of the list are indexed starting from one. The length of the list is 255.

The nominal mapping for a keyboard is almost the identity mapping, except that map[i]=0 for keycodes that have no corresponding physical key, and the first five entries indicate the keycodes (if any) corresponding to the Mod1 through Mod5 modifier bits.

ChangeKeyboardControl​

value-mask: BITMASK
value-list: LISTofVALUE
Errors: Match Value

Controls various aspects of the keyboard. The value-mask and value-list specify which controls are to be changed. The possible values are:

key-click-percent: INT8
bell-percent: INT8
bell-pitch: INT16
bell-duration: INT16
led: CARD8
led-mode: {On, Off}
key: KEYCODE
auto-repeat-mode: {On, Off, Default}

Key-click-percent sets the volume for key clicks between 0 (off) and 100 (loud) inclusive, if possible. Setting to -1 restores the default. Other negative values generate a Value error.

Bell-percent sets the base volume for the bell between 0 (off) and 100 (loud) inclusive, if possible. Setting to -1 restores the default. Other negative values generate a Value error.

Bell-pitch sets the pitch (specified in Hz) of the bell, if possible. Setting to -1 restores the default. Other negative values generate a Value error.

Bell-duration sets the duration (specified in milliseconds) of the bell, if possible. Setting to -1 restores the default. Other negative values generate a Value error.

If both led-mode and led are specified, then the state of that LED is changed, if possible. If only led-mode is specified, then the state of all LEDs are changed, if possible. At most 32 LEDs are supported, numbered from one. It is a Match error if an led is specified without an led-mode.

If both auto-repeat-mode and key are specified, then the auto-repeat mode of that key is changed, if possible. If only auto-repeat-mode is specified, then the global auto-repeat mode for the entire keyboard is changed, if possible, without affecting the per-key settings. It is a Match error if a key is specified without an auto-repeat-mode.

A bell generator connected with the console but not directly on the keyboard is treated as if it were part of the keyboard.

The order in which controls are verified and altered is server dependent. If an error is generated, a subset of the controls may have been altered.

GetKeyboardControl​

=>

key-click-percent: CARD8
bell-percent: CARD8
bell-pitch: CARD16
bell-duration: CARD16
led-mask: CARD32
global-auto-repeat: {On, Off}
auto-repeats: LISTofCARD8
Errors: Match

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.

Bell​

percent: INT8
Errors: Match, Value

Rings the bell on the keyboard at the specified volume relative to the base volume for the keyboard, if possible. Percent, which can range from -100 to 100 inclusive, is added to the base volume, and the sum limited to the range 0 to 100 inclusive.

SetPointerMapping​

map: LISTofCARD8

=>

status: {Success, Busy}
Errors: Value

Sets the mapping of the pointer. Elements of the list are indexed starting from one. The length of the list must be the same as GetPointerMapping would return. The index is a "core" button number, and the element of the list defines the "effective" number.

A zero element disables a button, and elements are not restricted in value by the number of physical buttons, but no two elements can have the same non-zero value.

If any of the buttons to be altered are currently in the down state,the status reply is Busy and the mapping is not changed.

GetPointerMapping​

=>

map: LISTofCARD8
Errors: Value

Returns the current mapping of the pointer. Elements of the list are indexed starting from one. The length of the list indicates the number of physical buttons.

The nominal mapping for a pointer is the identity mapping; map[i]=i.

ChangePointerControl​

do-acceleration, do-threshold: BOOL
acceleration-numerator, acceleration-denominator: INT16
threshold: INT16
Errors: Match, Value

Defines how the pointer moves. The acceleration is a multiplier for movement, expressed as a fraction. For example, specifying 3/1 means the pointer moves three times as fast as normal. The fraction may be rounded arbitrarily by the server. Acceleration only takes effect if the pointer moves more than threshold pixels at once, and only applies to the amount beyond the threshold. Setting a value to -1 restores the default. Other negative values generate a Value error, as does a zero value for acceleration-denominator.

GetPointerControl​

=>

acceleration-numerator, acceleration-denominator: CARD16
threshold: CARD16
Errors: Match

Returns the current acceleration and threshold for the pointer.

SetScreenSaver​

timeout, interval: INT16
prefer-blanking: {Yes, No, Default}
allow-exposures: {Yes, No, Default}
Errors: Value

Timeout and interval are specified in minutes; setting a value to -1 restores the default. Other negative values generate a Value error. If the timeout value is zero, screen-saver is disabled. If the timeout value is non-zero, screen-saver is enabled. Once screen-saver is enabled, if no input from the keyboard or pointer is generated for timeout minutes, screen-saver is activated. For each screen, if blanking is preferred and the hardware supports video blanking, the screen will simply go blank. Otherwise, if either exposures are allowed or the screen can be regenerated without sending exposure events to clients, the screen is tiled with the root window background tile, randomly re-origined each interval minutes if the interval value is non-zero. Otherwise, the state of the screen does not change and screen-saver is not activated. Screen-saver is deactivated, and all screen states are restored, at the next keyboard or pointer input or at the next ForceScreenSaver with mode Reset.

GetScreenSaver​

=>

timeout, interval: CARD16
prefer-blanking: {Yes, No}
allow-exposures: {Yes, No}

Returns the current screen-saver control values.

ForceScreenSaver​

mode: {Activate, Reset}

If the mode is Activate and screen-saver is currently deactivated, then screen-saver is activated (even if screen-saver has been disabled with a timeout value of zero). If the mode is Reset and screen-saver is currently enabled, then screen-saver is deactivated (if it was activated), and then the activation timer is reset to its initial state, as if device input had just been received.

ChangeHosts​

mode: {Insert, Delete}
host: HOST
Errors: Access, Value

Adds or removes the specified host from the access control list. When the access control mechanism is enabled and a host attempts to establish a connection to the server, the host must be in this list or the server will refuse the connection.

The client must reside on the same host as the server, and/or have been granted permission in the initial authorization at connection setup.

An initial access control list can be specified, typically by naming a file that the server reads at startup and reset.

ListHosts​

=>

mode: {Enabled, Disabled}
hosts: LISTofHOST

Returns the hosts on the access control list, and whether use of the list at connection setup is currently enabled or disabled.

Each HOST is padded to a multiple of four bytes.

ChangeAccessControl​

mode: {Enable, Disable}
Errors: Value, Access

Enables or disables the use of the access control list at connection setups.

The client must reside on the same host as the server, and/or have been granted permission in the initial authorization at connection setup.

ChangeCloseDownMode​

mode: {Destroy, RetainPermanent, RetainTemporary}
Errors: Value

Defines what will happen to the client's resources at connection close. A connection starts in Destroy mode. The meaning of the close-down mode is described in Section 11.

KillClient​

resource: CARD32 or AllTemporary
Errors: Value

If a valid resource is specified, forces a close-down of the client that created the resource. If the client has already terminated in either RetainPermanent or RetainTemporary mode, all of the client's resources are destroyed (see Section 11). If AllTemporary is specified, then the resources of all clients that have terminated in RetainTemporary are destroyed.

NoOperation​

This request has no arguments and no results, but the request length field can be non-zero, allowing the request to be any multiple of 4 bytes in length. The bytes contained in the request are uninterpreted by the server.

This request can be used in its minimum 4 byte form as "padding" where necessary by client libraries that find it convenient to force requests to begin on 64-bit boundaries.