XF86MISC(3)
okay bestie, you opened the XF86MISC(3) page from the X FUNCTIONS manual, and itβs giving βI speak directly to the X serverβ energy π β¨
πΈ NAME πΈ
Meet the Extension library for the XFree86-Misc X extension squad, no cap:
XF86MiscQueryExtensionXF86MiscQueryVersionXF86MiscGetMouseSettingsXF86MiscSetMouseSettingsXF86MiscGetKbdSettingsXF86MiscSetKbdSettings
π οΈ SYNTAX π οΈ
Hereβs the whole cast, literally exactly like this:
#include <X11/extensions/xf86misc.h>
Bool XF86MiscQueryExtension(
Display *display,
int *event_base_return,
int *error_base_return);
Bool XF86MiscQueryVersion(
Display *display,
int *major_version_return,
int *minor_version_return);
Status XF86MiscGetMouseSettings(
Display *display,
XF86MiscMouseSettings *mseinfo);
Status XF86MiscSetMouseSettings(
Display *display,
XF86MiscMouseSettings *mseinfo);
Status XF86MiscGetKbdSettings(
Display *display,
XF86MiscKbdSettings *kbdinfo);
Status XF86MiscSetKbdSettings(
Display *display,
XF86MiscKbdSettings *kbdinfo);
π¬ ARGUMENTS π¬
displayβ Specifies the connection to the X server.screenβ Specifies which screen number the setting apply to.event_base_returnβ Returns the base event number for the extension.error_base_returnβ Returns the base error number for the extension.major_version_returnβ Returns the major version number of the extension.minor_version_returnβ Returns the minor version number of the extension.mseinfoβ Specifies a structure which contains the mouse parameters.kbdinfoβ Specifies a structure which contains the keyboard parameters.
π§ STRUCTURES π§
π Mouse π
typedef struct {
char *device; /β returned path to device */
int type; /β mouse protocol */
int baudrate; /β 1200, 2400, 4800, or 9600 */
int samplerate; /β samples per second */
int resolution; /β resolution, count per inch */
int buttons; /β number of buttons */
Bool emulate3buttons; /β Button1+Button3 -> Button2 ? */
int emulate3timeout; /β in milliseconds */
Bool chordmiddle; /β Button1+Button3 == Button2 ? */
int flags; /β Device open flags */
} XF86MiscMouseSettings;
β¨οΈ Keyboard β¨οΈ
typedef struct {
int type; /β of keyboard: 84-key, 101-key, Xqueue */
int rate; /β repeat rate */
int delay; /β delay until repeat starts */
Bool servnumlock; /β Server handles NumLock ? */
} XF86MiscKbdSettings;
π DESCRIPTION π
These functions provide an interface to the XFree86-Misc extension which allows various server settings to be queried and changed dynamically. Applications that use these functions must be linked with -lXxf86misc.
π€ POWER-SAVER FUNCTIONS π€
The XF86MiscGetSaver and XF86MiscSetSaver functions have been removed. This functionality is now provided by the DPMS extension.
π MOUSE FUNCTIONS π
Mouse parameters can be queried using the function XF86MiscGetMouseSettings. The structure pointed to by its second argument is filled in with the current mouse settings.
Not all fields are valid in all cases. For example, when the protocol indicates a bus mouse (i.e. the type field has value MTYPE_BUSMOUSE as defined in xf86misc.h), then the value in the baudrate field should be ignored as it does not apply to bus mice.
The samplerate field contains the resolution in lines per inch when using the Hitachi tablet protocol.
The device field of the structure points to dynamically allocated storage which should be freed by the caller.
Any of the fields of the structure can be altered and then passed to the XF86MiscSetMouseSettings function to change their value in the server, with the following restrictions:
- The
devicecan not be changed - The protocol can not be changed to or from
XqueueorOsMouse - The
buttonsfield can not be changed - Invalid combinations of parameters are not allowed
The server will generate an error if any of the above is attempted, except the first - the contents of the device field are simply ignored.
A change of the protocol causes the device to be closed and reopened. Changes to the baud rate, sample rate, resolution or flags, when applicable to the selected protocol, also cause a reopen of the device. A reopen can be forced by using the MF_REOPEN flag, except in the case of the OsMouse and Xqueue protocols which ignore all attempts to reopen the device.
β¨οΈ KEYBOARD FUNCTIONS β¨οΈ
The XF86MiscGetKbdSettings function allows you to retrieve the current keyboard-related settings from the server.
Using the XF86MiscSetKbdSettings function, the keyboard autorepeat delay and rate can be set. Requests to change the type and servnumlock fields are ignored (except for checking for an invalid keyboard type). This is expected to change in a future release.
π OTHER FUNCTIONS π
Two functions, XF86MiscQueryExtension and XF86MiscQueryVersion, are provided which allow the client to query some information regarding the extension itself.
β PREDEFINED VALUES β
The header file X11/extensions/xf86misc.h contains definitions for:
MTYPE_*β Mouse protocolsKTYPE_*β Keyboard typesMF_*β Mouse flags
π¦ SEE ALSO π¦
Go peek at xset(1) and xorg.conf(5) β iykyk π
π AUTHORS π
Joe Moss and David Dawes, The XFree86 Project, Inc.
and thatβs the whole vibe, bestie β this page is from X Version 11, libXxf86misc 1.0.4, and itβs literally the XF86MISC(3) page πβ¨
π¦ where this page comes from
- nixos 26.05: libxxf86misc 1.0.4
- nixpkgs unstable: libxxf86misc 1.0.4
- Copyright (c) 1996 Joe Moss, The XFree86 Project
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms