XSetDeviceButtonMapping, XGetDeviceButtonMapping − query or change device button mappings


#include <X11/extensions/XInput.h>

int XSetDeviceButtonMapping( Display *display,
XDevice *device,
unsigned char map[],
int nmap);

int XGetDeviceButtonMapping( Display *display,
XDevice *device,
unsigned char map_return[],
int nmap);

Specifies the connection to the X server.

Specifies the device whose button mapping is to be
queried or changed.

Specifies the mapping list.

Returns the mapping list.

Specifies the number of items in the mapping list.


The XSetDeviceButtonMapping request sets the mapping of the
specified device. If it succeeds, the X server generates a
DeviceMappingNotify event, and XSetDeviceButtonMapping returns
MappingSuccess. Element map[i] defines the logical button
number for the physical button i+1. The length of the list must
be the same as XGetDeviceButtonMapping would return, or a
BadValue error results. A zero element disables a button, and
elements are not restricted in value by the number of physical
buttons. However, no two elements can have the same nonzero
value, or a BadValue error results. If any of the buttons to be
altered are logically in the down state,
XSetDeviceButtonMapping returns MappingBusy, and the mapping is
not changed.

XSetDeviceButtonMapping can generate BadDevice, BadMatch, and
BadValue errors.

The XGetDeviceButtonMapping request returns the current mapping
of the specified device. Buttons are numbered starting from
one.XGetDeviceButtonMapping returns the number of physical
buttons actually on the device. The nominal mapping for a
device is map[i]=i+1. The nmap argument specifies the length of
the array where the device mapping is returned, and only the
first nmap elements are returned in map_return.

XGetDeviceButtonMapping can generate BadDevice or BadMatch


An invalid device was specified. The specified device
does not exist or has not been opened by this client via
XOpenInputDevice. This error may also occur if the
specified device is the X keyboard or X pointer device.

This error may occur if an XGetDeviceButtonMapping or
XSetDeviceButtonMapping request was made specifying a
device that has no buttons.

Some numeric value falls outside the range of values
accepted by the request. Unless a specific range is
specified for an argument, the full range defined by the
argument´s type is accepted. Any argument defined as a
set of alternatives can generate this error.


XChangeDeviceKeyboardControl(3), XChangeDeviceKeyMapping(3),

More Linux Commands

optionRestore(3) restore option state from memory copy......
Copy back the option state from saved memory. The allocated memory is left intact, so this routine can be called repeatedly without having to call optionSaveSta

domainname(1) - show or set the system's NIS/YP domain name
Hostname is the program that is used to either set or display the current host, domain or node name of the system. These names are used by many of the networkin

snmp_read(3) - netsnmp_session_api functions (Man Page).....
Snmp_sess_init prepares a netsnmp_session that sources transport characteristics and common information that will be used for a set of SNMP transactions. After

seek(n) - Change the access position for an open channel....
Changes the current access position for channelId. ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdin, stdout, or stderr)

accept4(2) - accept a connection on a socket (Man Page).....
The accept() system call is used with connection-based socket types (SOCK_STREAM, SOCK_SEQPACKET). It extracts the first connection request on the queue of pend

amavisd-milter(8) - sendmail milter for amavisd-new.........
The amavisd-milter is a sendmail milter (mail filter) for amavisd-new 2.4.3 and above and sendmail 8.13 and above (limited support for 8.12 is provided). Instea

dfutool(1) - Device Firmware Upgrade utility (Man Page).....
dfutool is used to verify, archive and upgrade firmware files. OPTIONS -h Gives a list of possible commands. -d &lt;device&gt; The command specifies the device to use

getwc_unlocked(3) - nonlocking stdio functions (Man Page)...
Each of these functions has the same behavior as its counterpart without the _unlocked suffix, except that they do not use locking (they do not set locks themse

pcre32_config(3) Perl-compatible regular expressions........
This function makes it possible for a client program to find out which optional features are available in the version of the PCRE library it is using. The argum

gnutls_db_check_entry(3) - API function - Linux manual page
Check if database entry has expired. This function is to be used when you want to clear unnesessary session which occupy space in your backend. RETURNS Returns

avahi-daemon.conf(5) - avahi-daemon configuration file......
avahi-daemon.conf is the configuration file for avahi-daemon. SECTION [SERVER] host-name= Set the host name avahi-daemon tries to register on the LAN. If omited

curl_formget(3) - serialize a previously built multipart/for
curl_formget() is used to serialize data previously built/appended with curl_formadd(3). Accepts a void pointer as second argument named userp which will be pas

We can't live, work or learn in freedom unless the software we use is free.