| 1 |
'\" t |
| 2 |
.\" Title: xsetdevicebuttonmapping |
| 3 |
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] |
| 4 |
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> |
| 5 |
.\" Date: 09/05/2024 |
| 6 |
.\" Manual: \ \& |
| 7 |
.\" Source: \ \& |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "XSETDEVICEBUTTONMAPP" "libmansuffix" "09/05/2024" "\ \&" "\ \&" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
XSetDeviceButtonMapping, XGetDeviceButtonMapping \- query or change device button mappings |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.nf |
| 35 |
#include <X11/extensions/XInput\&.h> |
| 36 |
.fi |
| 37 |
.sp |
| 38 |
.nf |
| 39 |
int XSetDeviceButtonMapping( Display *display, |
| 40 |
XDevice *device, |
| 41 |
unsigned char map[], |
| 42 |
int nmap); |
| 43 |
.fi |
| 44 |
.sp |
| 45 |
.nf |
| 46 |
int XGetDeviceButtonMapping( Display *display, |
| 47 |
XDevice *device, |
| 48 |
unsigned char map_return[], |
| 49 |
int nmap); |
| 50 |
.fi |
| 51 |
.sp |
| 52 |
.nf |
| 53 |
display |
| 54 |
Specifies the connection to the X server\&. |
| 55 |
.fi |
| 56 |
.sp |
| 57 |
.nf |
| 58 |
device |
| 59 |
Specifies the device whose button mapping is to be |
| 60 |
queried or changed\&. |
| 61 |
.fi |
| 62 |
.sp |
| 63 |
.nf |
| 64 |
map |
| 65 |
Specifies the mapping list\&. |
| 66 |
.fi |
| 67 |
.sp |
| 68 |
.nf |
| 69 |
map_return |
| 70 |
Returns the mapping list\&. |
| 71 |
.fi |
| 72 |
.sp |
| 73 |
.nf |
| 74 |
nmap |
| 75 |
Specifies the number of items in the mapping list\&. |
| 76 |
.fi |
| 77 |
.SH "DESCRIPTION" |
| 78 |
.sp |
| 79 |
.if n \{\ |
| 80 |
.RS 4 |
| 81 |
.\} |
| 82 |
.nf |
| 83 |
The XSetDeviceButtonMapping request sets the mapping of the |
| 84 |
specified device\&. If it succeeds, the X server generates a |
| 85 |
DeviceMappingNotify event, and XSetDeviceButtonMapping returns |
| 86 |
MappingSuccess\&. Element map[i] defines the logical button |
| 87 |
number for the physical button i+1\&. The length of the list must |
| 88 |
be the same as XGetDeviceButtonMapping would return, or a |
| 89 |
BadValue error results\&. A zero element disables a button, and |
| 90 |
elements are not restricted in value by the number of physical |
| 91 |
buttons\&. However, no two elements can have the same nonzero |
| 92 |
value, or a BadValue error results\&. If any of the buttons to be |
| 93 |
altered are logically in the down state, |
| 94 |
XSetDeviceButtonMapping returns MappingBusy, and the mapping is |
| 95 |
not changed\&. |
| 96 |
.fi |
| 97 |
.if n \{\ |
| 98 |
.RE |
| 99 |
.\} |
| 100 |
.sp |
| 101 |
.if n \{\ |
| 102 |
.RS 4 |
| 103 |
.\} |
| 104 |
.nf |
| 105 |
XSetDeviceButtonMapping can generate BadDevice, BadMatch, and |
| 106 |
BadValue errors\&. |
| 107 |
.fi |
| 108 |
.if n \{\ |
| 109 |
.RE |
| 110 |
.\} |
| 111 |
.sp |
| 112 |
.if n \{\ |
| 113 |
.RS 4 |
| 114 |
.\} |
| 115 |
.nf |
| 116 |
The XGetDeviceButtonMapping request returns the current mapping |
| 117 |
of the specified device\&. Buttons are numbered starting from |
| 118 |
one\&. XGetDeviceButtonMapping returns the number of physical |
| 119 |
buttons actually on the device\&. The nominal mapping for a |
| 120 |
device is map[i]=i+1\&. The nmap argument specifies the length of |
| 121 |
the array where the device mapping is returned, and only the |
| 122 |
first nmap elements are returned in map_return\&. |
| 123 |
.fi |
| 124 |
.if n \{\ |
| 125 |
.RE |
| 126 |
.\} |
| 127 |
.sp |
| 128 |
.if n \{\ |
| 129 |
.RS 4 |
| 130 |
.\} |
| 131 |
.nf |
| 132 |
XGetDeviceButtonMapping can generate BadDevice or BadMatch |
| 133 |
errors\&. |
| 134 |
.fi |
| 135 |
.if n \{\ |
| 136 |
.RE |
| 137 |
.\} |
| 138 |
.SH "DIAGNOSTICS" |
| 139 |
.sp |
| 140 |
.if n \{\ |
| 141 |
.RS 4 |
| 142 |
.\} |
| 143 |
.nf |
| 144 |
BadDevice |
| 145 |
An invalid device was specified\&. The specified device |
| 146 |
does not exist or has not been opened by this client via |
| 147 |
XOpenInputDevice\&. This error may also occur if the |
| 148 |
specified device is the X keyboard or X pointer device\&. |
| 149 |
.fi |
| 150 |
.if n \{\ |
| 151 |
.RE |
| 152 |
.\} |
| 153 |
.sp |
| 154 |
.if n \{\ |
| 155 |
.RS 4 |
| 156 |
.\} |
| 157 |
.nf |
| 158 |
BadMatch |
| 159 |
This error may occur if an XGetDeviceButtonMapping or |
| 160 |
XSetDeviceButtonMapping request was made specifying a |
| 161 |
device that has no buttons\&. |
| 162 |
.fi |
| 163 |
.if n \{\ |
| 164 |
.RE |
| 165 |
.\} |
| 166 |
.sp |
| 167 |
.if n \{\ |
| 168 |
.RS 4 |
| 169 |
.\} |
| 170 |
.nf |
| 171 |
BadValue |
| 172 |
Some numeric value falls outside the range of values |
| 173 |
accepted by the request\&. Unless a specific range is |
| 174 |
specified for an argument, the full range defined by the |
| 175 |
argument\*(Aqs type is accepted\&. Any argument defined as a |
| 176 |
set of alternatives can generate this error\&. |
| 177 |
.fi |
| 178 |
.if n \{\ |
| 179 |
.RE |
| 180 |
.\} |
| 181 |
.SH "SEE ALSO" |
| 182 |
.sp |
| 183 |
.if n \{\ |
| 184 |
.RS 4 |
| 185 |
.\} |
| 186 |
.nf |
| 187 |
XChangeDeviceKeyboardControl(libmansuffix), XChangeDeviceKeyMapping(libmansuffix), |
| 188 |
XChangeDeviceModifierMapping(libmansuffix) |
| 189 |
.fi |
| 190 |
.if n \{\ |
| 191 |
.RE |
| 192 |
.\} |